Hi Jean,
All XIncludes are resolved by the parser before the DocBook stylesheet sees
the content. I think these problems should be presented to the libxml2
mailing list.
Right away you pointed out one non-conformance issue: the XInclude
standard says a missing href attribute is supposed to be the same thing as
an href="" attribute, but your tests show they behave differently.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net----- Original Message -----
From: "Jean Jordaan" <
jean.jordaan@gmail.com>
To: "Docbook Apps" <
docbook-apps@lists.oasis-open.org>
Sent: Monday, November 19, 2007 1:12 AM
Subject: [docbook-apps] Trying to understand XInclude usage
> Hi all
>
> I'm having some issues with modular documents. I'm using xmlto
>
http://cyberelk.net/tim/software/xmlto/> to process the DocBook to HTML. xmlto uses xsltproc. I'm using XXE from
> XMLMind to edit (I posted a different version of this mail to the XXE
> support list).
>
> (1) When xi:including elements in the same document, XXE writes e.g.::
>
> <xi:include href="" xmlns:xi="http://www.w3.org/2001/XInclude"
> xpointer="acronyms" />
>
> The 'href=""' makes xsltproc complain: "element include: XInclude error
> : detected a recursion in ../glossary.xml". It drops the offending
> directive.
>
> This works::
>
> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
> xpointer="acronyms" />
>
> (2) The 'acronyms' id refers to a <glossdiv> element, which itself
> contains includes. While xsltproc does resolve those includes in the
> original glossdiv occurence, it doesn't resolve them when they've been
> included. Here's a simplified snippet to illustrate::
>
> <glossary id="manual">
> <glossdiv>...</glossdiv>
> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
> xpointer="acronyms" />
> </glossary>
>
> <glossary>
> <glossdiv id="acronyms">
> <glossentry>
> <glossterm>...</glossterm>
> <glossdef>
> Some text .. <xi:include href="terms.xml"
> xmlns:xi="http://www.w3.org/2001/XInclude"
> xpointer="element(operator)" />
> </glossdef>
> </glossentry>
> </glossdiv>
> </glossary>
>
> When I process this, 'operator' is only resolved once. When processing
> the glossary with id 'manual', xsltproc reports: "No template matches
> xi:include in para.", and generates this HTML::
>
>
<xi:include></xi:include>>
> Is this an issue with xsltproc, or with the DocBook stylesheets?
>
> --
> jean . .. .... //\\\oo///\\
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
docbook-apps-unsubscribe@lists.oasis-open.org> For additional commands, e-mail:
docbook-apps-help@lists.oasis-open.org>
>
>