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 355373 - XInclude rangeto() loses nodes
XInclude rangeto() loses nodes
Status: RESOLVED DUPLICATE of bug 306081
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2006-09-11 05:29 UTC by Oleg Paraschenko
Modified: 2007-07-19 14:31 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Oleg Paraschenko 2006-09-11 05:29:28 UTC
Please describe the problem:
Libxml (CVS version from 10 September 2006) seems have a  error with XInclude and rangeto().

[doc.xml]
<doc>
  <ok>
    <xi:include href="inc.xml" xpointer="xpointer(/subdoc/sect[@id='id1']/range-to(following::sect[@id='id2']))" xmlns:xi="http://www.w3.org/2001/XInclude"/>
  </ok>
  <error>
    <xi:include href="inc.xml" xpointer="xpointer(/subdoc/sect[@id='id1']/range-to(following::sect[@id='id3']))" xmlns:xi="http://www.w3.org/2001/XInclude"/>
  </error>
</doc>
[/doc.xml]

[inc.xml]
<subdoc>
  <sect id="id1">lalala</sect>
  <sect id="id2">lalala</sect>
  <sect id="id3"><p>la</p></sect>
</subdoc>
[/inc.xml]

[screen]
$ xmllint --xinclude doc.xml 
<?xml version="1.0"?>
<doc>
  <ok>
    <sect id="id1">lalala</sect>
  <sect id="id2">lalala</sect>
  </ok>
  <error>
    <sect id="id1">lalala</sect>
  <sect id="id2">lalala</sect>
  <sect id="id3"><p/></sect>
  </error>
</doc>
[/screen]

The text content of the section with id='id3' is lost.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Daniel Veillard 2006-09-11 07:41:11 UTC
Range-to includes the target node but no node later than that in
document order, so it's normal the <p> and its children are not 
included. on the other hand the first pointer with id2 seems
wrong it should not include the subsequent text node...

XPointer has not seen much usage especially things like ranges
and points which are extensions to XPath core, you may be hitting bugs
more frequently if you use those...

Daniel
Comment 2 Patrik Fimml 2007-07-19 13:21:15 UTC
Same as bug #306081...
Comment 3 William M. Brack 2007-07-19 14:31:47 UTC

*** This bug has been marked as a duplicate of 306081 ***