GNOME Bugzilla – Bug 628363
Xinclude with xpointer produces incorrect output when included document contains comment elements
Last modified: 2021-07-05 13:24:27 UTC
doc1.xml: <?xml version="1.0" encoding="ISO-8859-1"?> <doc xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="doc2.xml" xpointer="xpointer(/doc/para[2]/range-to(/doc/para[5]))"/> </doc> doc2.xml <?xml version="1.0" encoding="ISO-8859-1"?> <doc> <!-- comment --> <para>Hello World 1</para> <!-- comment --> <para>Hello World 2</para> <!-- comment --> <para>Hello World 3</para> <!-- comment --> <para>Hello World 4</para> <!-- comment --> <para>Hello World 5</para> <!-- comment --> <para>Hello World 6</para> </doc> Command: xmllint --xinclude doc1.xml Result: <?xml version="1.0" encoding="ISO-8859-1"?> <doc xmlns:xi="http://www.w3.org/2001/XInclude"> <para>Hello World 2</para> </doc> Remove the comment elements from doc2.xml and the result is perfect: <?xml version="1.0" encoding="ISO-8859-1"?> <doc xmlns:xi="http://www.w3.org/2001/XInclude"> <para>Hello World 2</para> <para>Hello World 3</para> <para>Hello World 4</para> <para>Hello World 5</para> </doc>
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.