XalanJ2
  1. XalanJ2
  2. XALANJ-1478

bad XSL provides no useful error message

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5Dx
    • Fix Version/s: None
    • Component/s: Xalan
    • Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects. Anybody can view the issue.)
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC
    • Xalan info:
      PatchAvailable

      Description

      XSL below is bas because of contents of attribute 'test' on element 'if' - this
      crashes with message :

      (Location of error unknown)XSLT Error
      (javax.xml.transform.TransformerConfigurationException):
      javax.xml.transform.TransformerException: java.lang.RuntimeException:
      Programmers assertion in getNextStepPos: unknown stepType:

      {0}

      I think a line number would be better.

      ---------------------- XSL example ---------------------------
      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
      <xsl:template match="/">
      <xsl:if test=".='2' or " >
      </xsl:if>
      </xsl:template>
      </xsl:stylesheet

      1. patch.j1478.txt
        4 kB
        Henry Zongaro

        Activity

        rich gooding created issue -
        Hide
        Henry Zongaro added a comment -

        Thought I'd change the severity back from "enhancement" to "normal". I made a
        number of changes last year to try to tighten up the detection of syntax errors
        in XPath expressions - it looks like this is one that slipped through, and I
        think that ought to be regarded as a bug.

        Show
        Henry Zongaro added a comment - Thought I'd change the severity back from "enhancement" to "normal". I made a number of changes last year to try to tighten up the detection of syntax errors in XPath expressions - it looks like this is one that slipped through, and I think that ought to be regarded as a bug.
        Hide
        Ilene Seelemann added a comment -

        Note: Parser on xslt20 branch gives the following error:

        file:///F:/xslt20/xml-xalan/test/tests/conferr/numberingerr/badxpath.xsl; Line 3
        ; Column 31; XSLT Error (javax.xml.transform.TransformerConfigurationException):
        javax.xml.transform.TransformerException: javax.xml.transform.TransformerExcept
        ion: org.apache.xpath.parser.ParseException: Encountered "<EOF>" at line 1, colu
        mn 10.
        Was expecting one of:
        <IntegerLiteral> ...
        <DecimalLiteral> ...
        <DoubleLiteral> ...
        <StringLiteral> ...
        <AxisChild> ...
        <AxisDescendant> ...
        <AxisParent> ...
        <AxisAttribute> ...
        <AxisSelf> ...
        <AxisDescendantOrSelf> ...
        <AxisAncestor> ...
        <AxisFollowingSibling> ...
        <AxisPrecedingSibling> ...
        <AxisFollowing> ...
        <AxisPreceding> ...
        <AxisNamespace> ...
        <AxisAncestorOrSelf> ...
        "*" ...
        <NCNameColonStar> ...
        <StarColonNCName> ...
        "/" ...
        "//" ...
        "-" ...
        "+" ...
        "(" ...
        "@" ...
        <Some> ...
        <Every> ...
        <ForVariable> ...
        <CastAs> ...
        <TreatAs> ...
        <ValidateLbrace> ...
        <ValidateContext> ...
        <NodeLpar> ...
        <CommentLpar> ...
        <TextLpar> ...
        <ProcessingInstructionLpar> ...
        <IfLpar> ...
        "." ...
        ".." ...
        "$" ...
        <QName> ...
        <QNameLpar> ...

        Show
        Ilene Seelemann added a comment - Note: Parser on xslt20 branch gives the following error: file:///F:/xslt20/xml-xalan/test/tests/conferr/numberingerr/badxpath.xsl ; Line 3 ; Column 31; XSLT Error (javax.xml.transform.TransformerConfigurationException): javax.xml.transform.TransformerException: javax.xml.transform.TransformerExcept ion: org.apache.xpath.parser.ParseException: Encountered "<EOF>" at line 1, colu mn 10. Was expecting one of: <IntegerLiteral> ... <DecimalLiteral> ... <DoubleLiteral> ... <StringLiteral> ... <AxisChild> ... <AxisDescendant> ... <AxisParent> ... <AxisAttribute> ... <AxisSelf> ... <AxisDescendantOrSelf> ... <AxisAncestor> ... <AxisFollowingSibling> ... <AxisPrecedingSibling> ... <AxisFollowing> ... <AxisPreceding> ... <AxisNamespace> ... <AxisAncestorOrSelf> ... "*" ... <NCNameColonStar> ... <StarColonNCName> ... "/" ... "//" ... "-" ... "+" ... "(" ... "@" ... <Some> ... <Every> ... <ForVariable> ... <CastAs> ... <TreatAs> ... <ValidateLbrace> ... <ValidateContext> ... <NodeLpar> ... <CommentLpar> ... <TextLpar> ... <ProcessingInstructionLpar> ... <IfLpar> ... "." ... ".." ... "$" ... <QName> ... <QNameLpar> ...
        Serge Knystautas made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 18843 26387
        Henry Zongaro made changes -
        Priority Major [ 3 ]
        Hide
        Henry Zongaro added a comment -

        Attaching patch that should fix this problem.

        Show
        Henry Zongaro added a comment - Attaching patch that should fix this problem.
        Henry Zongaro made changes -
        Attachment patch.j1478.txt [ 18811 ]
        Henry Zongaro made changes -
        Bugzilla Id 18843
        Assignee Xalan Developers Mailing List [ xalan-dev@xml.apache.org ]
        Environment Operating System: Windows XP
        Platform: PC
        Operating System: Windows XP
        Platform: PC
        Description XSL below is bas because of contents of attribute 'test' on element 'if' - this
        crashes with message :

        (Location of error unknown)XSLT Error
        (javax.xml.transform.TransformerConfigurationException):
        javax.xml.transform.TransformerException: java.lang.RuntimeException:
        Programmers assertion in getNextStepPos: unknown stepType: {0}

        I think a line number would be better.


        ---------------------- XSL example ---------------------------
        <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
        <xsl:template match="/">
            <xsl:if test=".='2' or " >
            </xsl:if>
        </xsl:template>
        </xsl:stylesheet
        XSL below is bas because of contents of attribute 'test' on element 'if' - this
        crashes with message :

        (Location of error unknown)XSLT Error
        (javax.xml.transform.TransformerConfigurationException):
        javax.xml.transform.TransformerException: java.lang.RuntimeException:
        Programmers assertion in getNextStepPos: unknown stepType: {0}

        I think a line number would be better.


        ---------------------- XSL example ---------------------------
        <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
        <xsl:template match="/">
            <xsl:if test=".='2' or " >
            </xsl:if>
        </xsl:template>
        </xsl:stylesheet
        Xalan-keywords PatchAvailable
        Hide
        Brian Minchau added a comment -

        I've reviewed the patch. It looks fine to me.

        Show
        Brian Minchau added a comment - I've reviewed the patch. It looks fine to me.
        Henry Zongaro made changes -
        Assignee Henry Zongaro [ zongaro@ca.ibm.com ]
        Hide
        Henry Zongaro added a comment -

        Committed patch to CVS.

        Show
        Henry Zongaro added a comment - Committed patch to CVS.
        Henry Zongaro made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Brian Minchau made changes -
        Xalan info [PatchAvailable]
        Brian Minchau made changes -
        Xalan info [PatchAvailable]
        Brian Minchau made changes -
        Xalan info [PatchAvailable]
        Brian Minchau made changes -
        Xalan info [PatchAvailable]
        Brian Minchau made changes -
        Xalan info [PatchAvailable]
        Hide
        Brian Minchau added a comment -

        Filling in the reviewer field.

        Show
        Brian Minchau added a comment - Filling in the reviewer field.
        Brian Minchau made changes -
        Hide
        Brian Minchau added a comment -

        Rich, as the issue reporter please confirm that this is fixed to your satisfaction in the 2.7 release, then we can close this issue.

        Show
        Brian Minchau added a comment - Rich, as the issue reporter please confirm that this is fixed to your satisfaction in the 2.7 release, then we can close this issue.
        Hide
        rich gooding added a comment -

        Hi,
        tried it just now on 2.7.0 and its fixed - please close it.
        RG

        Show
        rich gooding added a comment - Hi, tried it just now on 2.7.0 and its fixed - please close it. RG
        Hide
        Brian Minchau added a comment -

        Closing this issue.

        Show
        Brian Minchau added a comment - Closing this issue.
        Brian Minchau made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Workflow jira [ 36382 ] Default workflow, editable Closed status [ 12569701 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12569701 ] jira [ 12593125 ]

          People

          • Assignee:
            Henry Zongaro
            Reporter:
            rich gooding
            Reviewer:
            Brian Minchau
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development