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

possible problem in SimpleNodeLocator::locationPathPattern

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Fixed
    • 1.0.x
    • None
    • XPathC
    • None
    • Operating System: All
      Platform: PC
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: