[oXygen-user] docbook 5 + entities + doctype +xincludes?

Sorin Ristache
Tue Jun 30 10:10:25 CDT 2009


Hello,


Robert Nagle wrote:
> Here's my question. My oxygen editor validated successfully only if I
> have a doctype declaration at the top of every xml document referenced
> by the xincludes in addition to the main document.
> 
> That doesn't make sense. That means I need to have  10 (or 100 or 200)
> instances of boilerplate code at the top of the doc.
> 
> If I put the doctype element only once in the main index file (the
> file with the references to the xincludes), shouldn't the validator
> be aware of the entity file after it was declared at the top of the
> main index file?  Or is this something quirky about the validation
> engine  which is requiring each file to have a doctype element?



A declaration of a DTD entity must be included in every XML file 
containing an entity reference because the entity references are 
expanded on the validator pipeline before resolving the XInclude include 
elements which means the entity declaration must be available in the 
same XML file where the entity is used. That is the entity declaration 
at the top of the main file is not available when the included files are 
parsed. I see that both Xerces and LibXML work in the same way with 
regard to XInclude and DTD entities.


> 
> Finally, I'm not sure I understand the syntax of the doctype element.
> (need to do some research). This reference goes to a public document,
> not to something local which I can maintain.
> 
> If I added this to the catalog under the framework/docbook5 directory,
> 
>    <system systemId="http://www.w3.org/2003/entities/iso8879/isopub.ent"
> uri="isopub.ent"/>
> 
> would this be sufficient?

Yes, if the local file isopub.ent is stored in the same folder as the 
XML catalog file. Relative paths are resolved relative to the location 
of the catalog file.


Regards,
Sorin



More information about the oXygen-user mailing list