[xml] XInclude fallback and missing root element



Hi,

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="http://www.w3.org/2003/XInclude";
      href="no-such-file.xml">
        <xi:fallback>Foo.</xi:fallback>
    </xi:include>

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

    <?xml version="1.0"?>

    Foo.

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?

Best regards,

Michael

--
Print XML with Prince!
http://www.princexml.com



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