[oXygen-user] xinclude error for docbook block

George Cristian Bina
Mon Feb 23 07:07:32 CST 2009


Dear Bram,

The error should be obtained when you validate the info.xml file and not 
the manual.xml file, right? At least this is the behavior I can reproduce.

This is an interesting case. The problem is that the DocBook grammar 
does not specify info as one of the allowed start elements and thus the 
error. There are two solutions, both possible with oXygen:

- use a modified DocBook schema that allows info as root
- validate the info.xml file in the context it is used from

In the first case you can include the DocBook schema and then add a 
choice start pattern like below:

<grammar xmlns="http://relaxng.org/ns/structure/1.0">
     <include href="docbookxi.rng"/>
     <start combine="choice">
         <ref name="db.info"/>
     </start>
</grammar>

In the second case you just need to define a validation scenario and add 
an entry to validate manual.xml with the default engine. Thus, intsead 
of validating info.xml directly oXygen will validate starting from 
manual.xml and info.xml will be validated in the context it is used.

Best Regards,
George
-- 
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Bram Vogelaar wrote:
> Hello All
> 
> i am trying to separate one of our docbook projects into smaller xml 
> files using the following structure
> 
> manual.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <?oxygen 
> RNGSchema="http://www.oasis-open.org/docbook/xml/5.0/rng/docbookxi.rng" 
> type="xml"?>
> <book xmlns="http://docbook.org/ns/docbook" 
> xmlns:xi="http://www.w3.org/2001/XInclude"
>     xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
>     <xi:include href="parts/info.xml"
>         xmlns:xi="http://www.w3.org/2001/XInclude">
>     </xi:include>
>     <xi:include href="parts/part1.xml"
>         xmlns:xi="http://www.w3.org/2001/XInclude">
>     </xi:include>
>     ........
> </book>
> 
> info.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <info xmlns="http://docbook.org/ns/docbook" version="5.0">
>     .......
> </info>
> 
> which results in the following error
> "E [oNVDL] element "info" from namespace "http://docbook.org/ns/docbook" 
> not allowed in this context"
> While including the info block straight  in the manual.xml (copy & 
> paste) there is no such error. Nor is this error triggered by
> any of the other xi:included files.
> 
> could some one please point me in the right direction to x::include the 
> info.xml file?
> 
> with regards
> Bram
> _______________________________________________
> oXygen-user mailing list
> 
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user



More information about the oXygen-user mailing list