Menu

#1327 Nested xincludes generate bad xml:base

other
pending-invalid
None
5
2014-01-24
2014-01-13
No

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

Discussion

  • Robert Stayton

    Robert Stayton - 2014-01-17

    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.

     
  • Robert Stayton

    Robert Stayton - 2014-01-17

    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.

     
  • Martin Večeřa

    Martin Večeřa - 2014-01-20

    Many thanks for the workaround and for pointing me to the root cause!

     
  • Robert Stayton

    Robert Stayton - 2014-01-24
    • status: open --> pending-invalid
    • assigned_to: Robert Stayton