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

Failed assertion on simple XPath syntax errors

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4
    • None
    • XPath
    • None
    • Operating System: Linux
      Platform: PC
    • 10995

    Description

      Using wrong (Java/C-style) '==' operator is a nasty trap.

      To cause an assertion failure, use the following xsl.

      I use command line with Sun JDK1.4 for Linux, jars in lib/endorsed. No source xml needed. See
      also Bug 2139.

      I think this should produce a helpful message instead.

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

      <!-- a simple XPath syntax error test -->

      <xsl:template match="doc">
      <xsl:if test="@atr == 'val'"/>

      <!-- You may also try: -->
      <xsl:if test="@atr = = 'val'"/>
      <xsl:if test="@atr ="/>
      <xsl:if test="@atr != != 'val'"/>
      <xsl:if test="@atr =!= 'val'"/>
      <xsl:if test="@atr => 'val'"/>
      <xsl:if test="@atr = + 'val'"/>
      </xsl:template>

      </xsl:stylesheet>

      Attachments

        Activity

          People

            Unassigned Unassigned
            kse@wp.pl kse
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: