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 633084 - xinclude with fallback: double fallback text node
xinclude with fallback: double fallback text node
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: xinclude
2.7.6
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2010-10-25 08:49 UTC by Sebastian Volland
Modified: 2020-08-17 12:45 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Volland 2010-10-25 08:49:37 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.
Comment 1 Nick Wellnhofer 2020-08-17 12:45:51 UTC
This was fixed with my recent changes to the XInclude code.