Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-994

variable as position predicate can get wrong node

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • 2.3
    • None
    • XPath
    • None
    • Operating System: Windows NT/2K
      Platform: PC
    • 8805

    Description

      I found a bug in Xalan 2.3.1 when using a predicate on the descendant-axis with
      position. It was an example on the Mulberry XSL-list. For the XML see attached
      test.xml, the XSL is the test.xsl, the result.xml stores the expected result.

      The Xalan bug is in the line 21, when removing the () from the select.

      <xsl:value-of select=".//description[$pos]"/> according to the spec at the end
      of 5.2 can only return description elements for "$pos = 1":

      "For example
      appendix//ulist/item[position()=1]
      matches a node if and only if all of the following are true:
      ...
      evaluating the PredicateExpr position()=1 with the node as context node and the
      siblings of the node that are item elements as the context node list yields true
      ..."

      Xalan shows the same behaviour with or without ().

      Joerg

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--test.xsl
          0.8 kB
          Jörg Heinicke
        2. ASF.LICENSE.NOT.GRANTED--test.xml
          0.8 kB
          Jörg Heinicke
        3. ASF.LICENSE.NOT.GRANTED--result.xml
          0.4 kB
          Jörg Heinicke

        Activity

          People

            mmidy@apache.org Myriam Midy
            joerg.heinicke@gmx.de Jörg Heinicke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: