GNOME Bugzilla – Bug 633084
xinclude with fallback: double fallback text node
Last modified: 2020-08-17 12:45:51 UTC
I have a xinclude with a fallback. The fallback contains a text node. When I evaluate the xpath string(/*[1]) on the result document to get the text content of the node, the result consists of the fallback-text two times, instead of once. test.xml: --- <root xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="does_not_exist.xml"> <xi:fallback>fallback-text</xi:fallback> </xi:include> </root> --- This is the bug: --- # xmllint -xinclude -xpath 'string(/*[1])' test.xml fallback-text fallback-text --- This returns the expected result: --- # xmllint -xinclude test.xml > resolved.xml # xmllint -xinclude -xpath 'string(/*[1])' resolved.xml fallback-text --- Reproducible with libxml 2.7.7 and the latest CVS head.
This was fixed with my recent changes to the XInclude code.