vidar.soerensen at kongsberg.com wrote:
> When I insert a system type DOCTYPE declarartion in a docbook.xml file
> I seem til loose the CSS binding in XXE, and it presentes the document
> with "no Style".
A DocBook document is detected using this rule (excerpts of
XXE_install_dir/addon/config/docbook/docbook.xxe):
---
<detect>
<and>
<rootElementNamespace xsi:nil="true" />
<not>
<dtdPublicId substring="true">Simplified</dtdPublicId>
</not>
<or>
<dtdPublicId substring="true">DTD DocBook</dtdPublicId>
<and>
<schemaType xsi:nil="true" />
<or>
<rootElementLocalName>part</rootElementLocalName>
<rootElementLocalName>chapter</rootElementLocalName>
<rootElementLocalName>refentry</rootElementLocalName>
<rootElementLocalName>appendix</rootElementLocalName>
<rootElementLocalName>glossary</rootElementLocalName>
<rootElementLocalName>section</rootElementLocalName>
<rootElementLocalName>sect1</rootElementLocalName>
<rootElementLocalName>sect2</rootElementLocalName>
<rootElementLocalName>sect3</rootElementLocalName>
<rootElementLocalName>book</rootElementLocalName>
<rootElementLocalName>article</rootElementLocalName>
</or>
</and>
</or>
</and>
</detect>
---
Note that the above detection is based on the publicId of the DTD or on
the name of the root element.
After a document has been detected as being DocBook, XXE automatically
uses a CSS style sheet for it. Hence, if the document is *not* detected
as being DocBook, you'll just see the tree view.
My guess is that, you have added a systemId and no publicId. Please
replace something like this:
---
<!DOCTYPE section SYSTEM "../foo/bar/docbookx.dtd">
---
by something like this:
---
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
---
This should fix your problem.
> I need the local DOCTYPE since I xi:include parts of the document using
> the xpointer="element(some_id)"
Yes, you are right. Processors such as xsltproc indeed require the
<!DOCTYPE> to properly handle xpointer="element(some_id)". (XXE does not
require the <!DOCTYPE>. When the <!DOCTYPE> is absent in the included
document, XXE automatically uses the DTD of the *including* document.)