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

Function Count on variable modifies number of nodes in variable.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.7
    • 2.7.1
    • transformation
    • None
    • PatchAvailable

    Description

      Transforming this XML:

      <A>
      <B>1</B>
      <B>2</B>
      </A>

      with the following XSL:

      <xsl:variable name="XML" select="/A"/>

      <xsl:template match="/">
      First:
      <xsl:value-of select="count($XML[B=1])"/>
      Second:
      <xsl:value-of select="count($XML[B=1])"/>
      Third:
      <xsl:value-of select="count($XML[B=1])"/>
      </xsl:template>

      the output is:

      First:
      1
      Second:
      2
      Third:
      3

      instead of:

      First:
      1
      Second:
      1
      Third:
      1

      Using XALAN 2.6 everithing works as it should be.

      Using:

      xalan.jar org.apache.xalan.xslt.Process -in %1 -xsl %2 -out %3

      instead of:

      transformer.transform(xml, xsl)

      the result is the right one!

      Filippo

      Attachments

        1. patch_jira_2204.txt
          0.7 kB
          Joanne Tong
        2. jira_2204.patch2.txt
          4 kB
          Brian Minchau
        3. jira_2204.patch3.txt
          9 kB
          Brian Minchau
        4. jira_2204.patch4.txt
          19 kB
          Brian Minchau

        Issue Links

          Activity

            People

              minchau@ca.ibm.com Brian Minchau
              fmunafo Filippo Munafò
              Henry Zongaro Henry Zongaro
              Votes:
              4 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: