Schramm, Martin wrote:
> 
> today I have detected an unknown feature of the XXE 3.5.2, I ask you to take 
> a look on:
> In my DocBook 4.5 XML file I have xincludes that reference on DocBook 
> elements WITHIN the document. These are used like variables for terms that 
> might be altered very often at all locations in the document (e.g. changing 
> department names).
> When I have got everything set in the document, the output in FO/PDF and HTML 
> is fine, all terms are displayed correctly. But oddly, when I change anything 
> minor and save the document again in the XXE 3.5.2, it adds an unwanted entry 
> 'href=""'. This entry then causes errors in the  FO/PDF and HTML output.
> 
> Before:
>   <title>Test of xincludes <xi:include 
> xmlns:xi="http://www.w3.org/2001/XInclude"; xpointer="element(/1/2/2/5/1/1/1)" 
> /></title>

This XInclude is correct.



> After:
>   <title>Test of xincludes <xi:include href="" 
> xmlns:xi="http://www.w3.org/2001/XInclude"; xpointer="element(/1/2/2/5/1/1/1)" 
> /></title>
> 

This XInclude is correct too. href="" is allowed by the XInclude
standard. Excerpts of http://www.w3.org/TR/xinclude/#include_element
---
The href attribute is optional; the absence of this attribute is the
same as specifying href="", that is, the reference is to the same document.
---

I've tested that XXE v4.5 works fine with or without href="" and also
that conversion to HTML, PDF, etc, from within XXE works fine with or
without href="".

I'm sure that this is also the case with ancient XXE v3.5.2. So my
question is: which tool do you use to convert your DocBook document to
HTML and PDF?

In fact, I doubt that href="" could be the cause of your problem.

Two ideas:

[1] To my knowledge, tools such as xsltproc and tools using Xerces as
their XML parser simply do not support an XInclude pointing to a part of
the same document, and this with or without href="".

[2] xpointer="element(/1/2/2/5/1/1/1)" is inherently fragile. If you
change anything in your document, the included element could vanish. We
recommend instead to give an ID to your common terms and then to include
them by their IDs.



> Is there a way to stop it from doing so?

No. Moreover we no longer support XXE v3.5.2, which is a quite old
version of XXE (February 19, 2007).

By the way, XXE v4.5 also adds href="" and for now, we fail to see a
good reason to remove this attribute.





Reply via email to