Re: [xml] XInclude fallback and missing root element

On Thu, Nov 23, 2006 at 06:50:39PM +1100, Michael Day wrote:

Funny things can happen when XInclude processing is run on a document 
that has an include as the root element. For example:

     <xi:include xmlns:xi="";

Running "xmllint --xinclude" on this document produces this output:

     <?xml version="1.0"?>


Which doesn't look like well-formed XML to me. Manipulating the document 
with the tree functions will find that there is no root element in this 
document at all after XInclude processing has taken place. Seems a bit odd!

Is there something better that libxml2 could do in this situation? Or is 
this a gap in the XInclude specification?

Paragraph 3 of section 4.5:
It is a fatal error to attempt to replace an xi:include element appearing
as the document (top-level) element in the source infoset with something
other than a list of zero or more comments, zero or more processing
instructions, and one element.

I guess it's a bug in libxml2 implementation :-)


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]