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 314788 - nodeset sort fails on a namespace node
nodeset sort fails on a namespace node
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: xpath
git master
Other Linux
: Normal normal
: ---
Assigned To: Nick Wellnhofer
Depends on:
Blocks:
 
 
Reported: 2005-08-29 20:10 UTC by Oleg Paraschenko
Modified: 2021-07-05 13:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (8.53 KB, patch)
2017-07-31 13:28 UTC, Nick Wellnhofer
none Details | Review

Description Oleg Paraschenko 2005-08-29 20:10:30 UTC
Consider the following code:

[code]
<x:stylesheet
  xmlns:x = "http://www.w3.org/1999/XSL/Transform"
  version = "1.0">
<!-- -->

<x:template match="/">
  <data aname="aval" xmlns:ns="ns:ns:ns">
    <t1><x:value-of select="string(//data/namespace::ns)"/></t1>
    <t2><x:value-of select="string(//data/@aname)"/></t2>
    <t3><x:value-of select="string(//data/@aname | //data/namespace::ns)"/></t3>
  </data>
</x:template>

</x:stylesheet>
[/code]

xsltproc produces:

[code]
<?xml version="1.0"?>
<data xmlns:ns="ns:ns:ns"
aname="aval"><t1>ns:ns:ns</t1><t2>aval</t2><t3>aval</t3></data>
[/code]

but expected result is:

[code]
<?xml version="1.0"?>
<data xmlns:ns="ns:ns:ns"
aname="aval"><t1>ns:ns:ns</t1><t2>aval</t2><t3>ns:ns:ns</t3></data>
[/code]

<t3>ns:ns:ns</t3> instead of <t3>aval</t3> is expected because namespace nodes
come before attribute nodes in the document order.
Comment 1 Nick Wellnhofer 2017-07-31 13:25:25 UTC
This is a bug in libxml2's XPath engine.
Comment 2 Nick Wellnhofer 2017-07-31 13:28:52 UTC
Created attachment 356642 [details] [review]
Proposed patch

Namespace nodes were simply ignored in the comparison functions.
Comment 3 GNOME Infrastructure Team 2021-07-05 13:24:48 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.