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

Exceptions not been thrown for transformation errors

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7
    • None
    • transformation
    • None
    • Windows 2000, jre1.5.0_01

    Description

      I am using Xalan2.7.0 for my transformations. When we transform a stylesheet and in style sheet we use sum(12) function. Now sum() is a aggreagate function and it should be supplied with node-list. In our case we are supplying 12 as an input. Now for this case since the xsl is invalid a transformation exception should be thrown.

      Xalan2.7.0 does not throw any exception and only a message is dispalyed on console saying "Can not convert #NUMBER to a NodeList!"
      For such type of scenarios since the transformation is invalid no output should be generated since we do not receive any exception then it works successfully even for Invalid stylesheets. For example my stylesheet is::

      <?xml version='1.0'?>
      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1" xmlns:java="http://xml.apache.org/xslt/java" xmlns:xalan="http://xml.apache.org/xalan" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://CommodityService.service.momentumWebServices" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:m0="http://ref.gs.domain.momentum.ams.com">
      <xsl:output method="xml" version="1.0" encoding="ISO-8859-1" indent="yes"/>
      <xsl:template match="/">
      <SOAP-ENV:Envelope>
      <SOAP-ENV:Body>
      <m:update>
      <xsl:for-each select="/SOAP-ENV:Envelope/SOAP-ENV:Body/m:update/m:MomentumCommodity">
      <m:MomentumCommodity>
      <m0:shortName>
      <xsl:value-of select="m0:shortName"/>
      </m0:shortName>
      <m0:defaultUnitOfMeasure>
      <xsl:value-of select="m0:defaultUnitOfMeasure"/>
      </m0:defaultUnitOfMeasure>
      <m0:activeFlag>
      <xsl:value-of select="sum(2)"/>
      </m0:activeFlag>
      </m:MomentumCommodity>
      </xsl:for-each>
      </m:update>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
      </xsl:template>
      </xsl:stylesheet>

      Attachments

        Activity

          People

            ilene@ca.ibm.com Ilene Seelemann
            pankaj Pankaj Singh
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: