Uploaded image for project: 'XalanC'
  1. XalanC
  2. XALANC-25

possible problem in SimpleNodeLocator::locationPathPattern

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.0.x
    • Fix Version/s: None
    • Component/s: XPathC
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: PC
    • Bugzilla Id:
      1926

      Description

      Xalan get wrong result for following input files:
      XML:
      <?xml version="1.0"?>
      <sss>
      <sss><i>XML</i></sss>
      </sss>

      XSLT:
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

      <xsl:template match="/">
      <xsl:apply-templates select="/sss/*" mode="b"/>
      </xsl:template>

      <xsl:template match="/sss//*" mode="b">
      <xsl:apply-templates select="i" mode="b"/>
      </xsl:template>

      </xsl:stylesheet>

      The XSLT result of Xalan:
      <?xml version="1.0" encoding="UTF-8"?>
      XML

      "XML" should not appear, it seems that there is something wrong in the algorithm
      of SimpleNodeLocator::locationPathPattern(stepPattern and nodeTest). When
      /sss/sss/i is selected, <xsl:template match="/sss//*" mode="b"> is not applied,
      Xalan choose the default rule instead.

      If I change the source file to:
      <?xml version="1.0"?>
      <sss>
      <ss><i>XML</i></ss>
      </sss>

      Then "XML" will not appear. Both the Xalan-C(1.0 and 1.1) and Xalan-j have the
      problem, Saxon can handle it correctly.

        Attachments

          Activity

            People

            • Assignee:
              david_n_bertoni@lotus.com David Bertoni
              Reporter:
              mfpeng@excite.com Mingfei Peng
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: