Hello,
I use docbook 5.0 through Maven plugin to create my project documentation. In the master file (https://github.com/PerfCake/Docs/blob/master/src/docbkx/perfcake-developers-guide.xml) I use xinclude to include chapters (e.g. https://github.com/PerfCake/Docs/blob/master/src/docbkx/chapters/dev-architecture.xml) on a relative path ./chapters. In the chapter I include some section (e.g. https://github.com/PerfCake/Docs/blob/master/src/docbkx/sections/architecture.xml) on a relative path ../sections.
The resulting relative path for the image included in the architecture.xml composed of ./chapters/../sections should be ./sections. Then the image should use filerel="../images/...". This does not work as docbook believes the current relative path is ./chapters/sections/.
Is there any workaround for this problem?
Many thanks,
Martin
I believe that the Maven plugin uses the Xerces parser with XInclude enabled, correct? If so, then I think this is a long-standing bug in Xerces:
https://issues.apache.org/jira/browse/XERCESJ-1102
There is no workaround for the XSL stylesheet, because the xml:base information it is provided by the XInclude processor in Xerces is incorrect, and the XSL would not know how to correct it.
Workaround: use xmllint --xinclude to resolve XIncludes first.
It looks like the Maven plugin also supports XOM instead of Xerces as the XInclude processor. Search for "Advanced XInclude Support" on this page:
http://docbkx-tools.sourceforge.net/docbkx-samples/manual.html
I'm pretty sure XOM will not have this bug in xml:base attributes.
Many thanks for the workaround and for pointing me to the root cause!