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 707476 - Unexpected counting behaviour with position() and extra predicates
Unexpected counting behaviour with position() and extra predicates
Status: RESOLVED DUPLICATE of bug 695699
Product: libxslt
Classification: Platform
Component: general
1.0.28
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2013-09-04 15:07 UTC by Heiko Jansen
Modified: 2013-09-23 19:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
XML input (151 bytes, application/xml)
2013-09-04 15:07 UTC, Heiko Jansen
Details
First stylesheet (708 bytes, application/xml)
2013-09-04 15:08 UTC, Heiko Jansen
Details
Second stylesheet (748 bytes, application/xml)
2013-09-04 15:09 UTC, Heiko Jansen
Details
Apparently problematic stylesheet (730 bytes, application/xml)
2013-09-04 15:09 UTC, Heiko Jansen
Details

Description Heiko Jansen 2013-09-04 15:07:04 UTC
LibXSLT behaves unexpectedly and imho inconsistently when I try to use "position()" to match certain elements.

When I try to transform the simple xml tree in the attached "input.xml", the stylesheets "ok1.xslt" and "ok2.xslt" give this output:
<OUT_TREE>
  <OUT_TWIG>
    <OUT_LEAF_FIRST>a_first</OUT_LEAF_FIRST>
  </OUT_TWIG>
  <OUT_TWIG>
    <OUT_LEAF_FIRST>b_first</OUT_LEAF_FIRST>   <!--- cf. below
    <OUT_LEAF_OTHER>b_second</OUT_LEAF_OTHER>
  </OUT_TWIG>
</OUT_TREE>

Using "dubious.xslt", however, leads to this result:
<OUT_TREE>
  <OUT_TWIG>
    <OUT_LEAF_FIRST>a_first</OUT_LEAF_FIRST>
  </OUT_TWIG>
  <OUT_TWIG>
    <OUT_LEAF_OTHER>b_first</OUT_LEAF_OTHER>    <--- here
    <OUT_LEAF_OTHER>b_second</OUT_LEAF_OTHER>
  </OUT_TWIG>
</OUT_TREE>

To verify the inconsistency I ran the same tests using Xalan-C (Xalan version 1.11.0, Xerces version 3.1.1), Xalan-J2 (2.7.0), and Saxon9 (Saxon-HE 9.4.0.4J ) on openSUSE 12.3 x64. All three processors give me the first output shown above with any of the three stylesheets.

So only xsltproc behaves differently when using "dubious.xslt".
Comment 1 Heiko Jansen 2013-09-04 15:07:53 UTC
Created attachment 254100 [details]
XML input

The XML input referred to in the bug report.
Comment 2 Heiko Jansen 2013-09-04 15:08:40 UTC
Created attachment 254101 [details]
First stylesheet
Comment 3 Heiko Jansen 2013-09-04 15:09:02 UTC
Created attachment 254102 [details]
Second stylesheet
Comment 4 Heiko Jansen 2013-09-04 15:09:29 UTC
Created attachment 254103 [details]
Apparently problematic stylesheet
Comment 5 Nick Wellnhofer 2013-09-23 19:50:59 UTC

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