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 314358 - Added xml:id attributes not considered to be IDs
Added xml:id attributes not considered to be IDs
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: general
2.6.20
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-08-24 08:54 UTC by Jamie Norrish
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jamie Norrish 2005-08-24 08:54:41 UTC
Version details: Debian package version: 2.6.20-1
Distribution/Version: Debian GNU/Linux unstable

Using the Python bindings, xml:id attribute values are not considered to be IDs
for the purposes of (at least) the XPath id function.

To reproduce, add an xml:id attribute to an element in an existing doc:

    ns = root.searchNsByHref(doc, 'http://www.w3.org/XML/1998/namespace')
    prop = elem.setNsProp(ns, 'id', 'b')

Then try finding that element using the XPath id function:

    ctxt = doc.xpathNewContext()
    print bool(ctxt.xpathEval('id("b")'))

And False is printed.

The expected result is that it finds the element and prints True.

The potentially useful doc.addID(None, 'b', prop) doesn't work because addID is
not generated in the Python bindings.
Comment 1 Daniel Veillard 2005-09-03 13:30:59 UTC
Okay I fixed this (and a bunch of other ID related problems) in CVS,

  thanks !

Daniel
Comment 2 Jamie Norrish 2005-09-03 21:18:14 UTC
Fantastic, Daniel - thank you!
Comment 3 Daniel Veillard 2005-09-05 08:58:55 UTC
This should be closed by release of libxml2-2.6.21,

  thanks,

Daniel