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 309864 - xpath attribute::name matches fails
xpath attribute::name matches fails
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: general
2.6.19
Other Linux
: Normal major
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-07-09 05:09 UTC by Ralf Corsepius
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ralf Corsepius 2005-07-09 05:09:44 UTC
Version details: Fedora Core RPMS
Distribution/Version: Fedora Core

Given this document (test.xml):
<opt name="foo"/>

Trying to evaluate xpath child::opt/attribute::name 
with libxml-2.6.19 (FC4) fails to find the attribute:

# xmlint --shell test.xml
/ > xpath child::opt/attribute::name
Object is a Node Set :
Set contains 0 nodes:

With libxml-2.6.16 (FC3) the same succeeds:
# xmllint --shell test.xml
/ > xpath child::opt/attribute::name
Object is a Node Set :
Set contains 1 nodes:
1  ATTRIBUTE name
    TEXT
      content=foo

However, xpath child::opt/attribute::* with both versions succeeds.
Comment 1 William M. Brack 2005-07-09 14:01:19 UTC
There is a problem within the xpath evaluation with 'attribute::name'. The fix
for this is currently under discussion and should be resolved soon; in the
meantime, you should find that 'child::opt/@name' works as expected.

*** This bug has been marked as a duplicate of 309580 ***
Comment 2 Ralf Corsepius 2005-07-10 06:02:52 UTC
I am having doubts on this PR to be a duplicate of PR 309580, because

1. I am able to reproduce the results above without having libxslt installed.

# rpm -q libxslt libxml2
package libxslt is not installed
libxml2-2.6.19-1

2. Downgrading from libxml2-2.6.19 to libxml2-2.6.16 lets this issue disappear:

# cat xyz.xml
<opt name="foo"/>

# xmllint --shell xyz.xml
/ > xpath child::opt/attribute::name
Object is a Node Set :
Set contains 0 nodes:
/ > xpath child::opt/attribute::*
Object is a Node Set :
Set contains 1 nodes:
1  ATTRIBUTE name
    TEXT
      content=foo

Downgrading:
# rpm -U --oldpackage libxml2-2.6.16-3.i386.rpm --nodeps

# xmllint --shell xyz.xml
/ > xpath child::opt/attribute::name
Object is a Node Set :
Set contains 1 nodes:
1  ATTRIBUTE name
    TEXT
      content=foo
/ > xpath child::opt/attribute::*
Object is a Node Set :
Set contains 1 nodes:
1  ATTRIBUTE name
    TEXT
      content=foo

=> This is a bug in libxml2, not in libxslt
Comment 3 William M. Brack 2005-07-10 07:20:40 UTC
libxslt uses libxml2.  Although the bug report was filed under libxslt (because
that's where the problem was encountered), the actual problem is within the
XPath module of libxml2.  The resolution of that bug will actually involve a
change to the current code of libxml2/xpath.c.  Trust me, as soon as bug 309580
is fixed, this problem will also be fixed :-)
Comment 4 Ralf Corsepius 2005-07-10 07:25:52 UTC
OK, this give sense - Thanks for clarifying this.
Comment 5 Daniel Veillard 2005-07-10 21:47:25 UTC
I think I fixed it in CVS, this was introduced in 2.6.19 and will be
fixed in 2.6.20,

  thanks for the heads up !

Daniel
Comment 6 Daniel Veillard 2005-09-05 09:01:10 UTC
This should be closed by release of libxml2-2.6.21,

  thanks,

Daniel