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

xsl:param to xsl:variable redefinition error not properly handled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7
    • None
    • XSLTC
    • None
    • PatchAvailable

    Description

      The following XSL is not correct but XSLTC does not identify the problem line and does not continue to process the rest of the document.

      <?xml version="1.0"?>

      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:param name="this_pagerule_hints" />
      <xsl:variable name="this_pagerule_hints" />

      <xsl:template match="/">
      <xsl:param name="this_pagerule_hint" />
      <xsl:variable name="this_pagerule_hint" />
      </xsl:template>

      </xsl:stylesheet>

      java -cp xalan.jar org.apache.xalan.xsltc.cmdline.Compile test.xsl

      This is what the compiler outputs:

      java.lang.ClassCastException: org.apache.xalan.xsltc.compiler.Variable
      at org.apache.xalan.xsltc.compiler.SymbolTable.addParam(SymbolTable.java
      :85)
      at org.apache.xalan.xsltc.compiler.Param.parseContents(Param.java:133)
      at org.apache.xalan.xsltc.compiler.Stylesheet.parseOwnChildren(Styleshee
      t.java:575)
      at org.apache.xalan.xsltc.compiler.Stylesheet.parseContents(Stylesheet.j
      ava:557)
      at org.apache.xalan.xsltc.compiler.Parser.createAST(Parser.java:381)
      at org.apache.xalan.xsltc.compiler.XSLTC.compile(XSLTC.java:344)
      at org.apache.xalan.xsltc.compiler.XSLTC.compile(XSLTC.java:253)
      at org.apache.xalan.xsltc.compiler.XSLTC.compile(XSLTC.java:389)
      at org.apache.xalan.xsltc.cmdline.Compile.main(Compile.java:129)
      Compiler errors:
      org.apache.xalan.xsltc.compiler.Variable

      This is what it should output:

      Compiler errors:
      file:/C:/cygwin/home/mloiselle/Projects/TheLevel/java/packages/org.apache.xalan/build/test.xsl: line 5:
      Variable 'this_pagerule_hints' is multiply defined in the same scope.
      file:/C:/cygwin/home/mloiselle/Projects/TheLevel/java/packages/org.apache.xalan/build/test.xsl: line 9:
      Variable 'this_pagerule_hint' is multiply defined in the same scope.

      Attachments

        1. patch.j2362.txt
          2 kB
          Marc Loiselle

        Activity

          People

            Unassigned Unassigned
            marcloiselle Marc Loiselle
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: