After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 628363 - Xinclude with xpointer produces incorrect output when included document contains comment elements
Xinclude with xpointer produces incorrect output when included document conta...
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: xinclude
2.7.3
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2010-08-30 19:51 UTC by bob_somerset
Modified: 2021-07-05 13:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description bob_somerset 2010-08-30 19:51:07 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>
Comment 1 GNOME Infrastructure Team 2021-07-05 13:24:27 UTC
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.