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

Explicit child axis specifier not handled correctly in patterns

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Fixed
    • 2.7.1
    • None
    • XPath
    • None
    • Operating System: All
      Platform: All
    • 9834

    Description

      If a Pattern has a StepPattern that specifies the child axis and is followed
      by '//', Xalan fails to correctly match nodes to that pattern. For example,
      using the following stylesheet

      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output method="text"/>
      <xsl:template match="root/child::l1//l3">
      <xsl:text>Rule root/child::l1//l3; value of matched node: </xsl:text>
      <xsl:value-of select='.'/>
      </xsl:template>
      </xsl:stylesheet>

      and the following document

      <?xml version="1.0"?>
      <root>
      <l1>
      <l2>
      <l3>root-l1-l2-l3</l3>
      </l2>
      </l1>
      </root>

      the result should be

      Rule root/child::l1//l3; value of matched node: root-l1-l2-l3

      but Xalan produces the following.

      root-l1-l2-l3

      If the StepPattern following the '//' also has a child axis specifier(e.g.,
      match="root/child::l1//child::l3", the following error results:

      file:///E:/users/henry/defects/d5016/newtest/newbug2.xsl; Line 3; Column 51; XSL
      T Error (javax.xml.transform.TransformerConfigurationException): javax.xml.trans
      form.TransformerException: javax.xml.transform.TransformerException: Extra illeg
      al tokens: '::', 'l3'

      Attachments

        Activity

          People

            zongaro@ca.ibm.com Henry Zongaro
            zongaro@ca.ibm.com Henry Zongaro
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: