You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2004/01/15 14:23:49 UTC

DO NOT REPLY [Bug 26167] New: - exsl:node-set warning (error)

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26167>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26167

exsl:node-set warning (error)

           Summary: exsl:node-set warning (error)
           Product: XalanC
           Version: 1.6
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: XalanC
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: dmsk@pobox.sk


I have an problem with XalanC 1.6 and exsl:node-set function. In some cases, XalanC
returns "XSLT warning: Invalid argument type in EXSLT function node-set()
 source tree node ............". Problem is, that our server component tests returns
from Xalan and when some warning/error occures, component fails.When I use xalan command
line, warnings occures, but result of transformation is OK. Other xslt processors has
no problem with my xslt stylesheet.

Here is an example code to explain problem. It's not my real stylesheet, but good example:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.
org/common" version="1.0">
  <xsl:output method="text" encoding="windows-1250"/>

	<xsl:template match="/">

		<!-- OK -->
		<xsl:call-template name="test1"/>

		<!-- WARNING -->
		<xsl:call-template name="test2"/>

		<!-- OK -->
		<xsl:call-template name="test3"/>

		<!-- WARNING -->
		<xsl:call-template name="test4"/>

	</xsl:template>

	<xsl:template name="test1">
		<xsl:variable name="dt">normal <MIDDLE> middle </MIDDLE></xsl:variable>
		<xsl:call-template name="problem_template">
			<xsl:with-param name="data" select="$dt"/>
		</xsl:call-template>
	</xsl:template>

	<xsl:template name="test2">
		<xsl:call-template name="problem_template">
			<xsl:with-param name="data" select="/xmldata"/>
		</xsl:call-template>
	</xsl:template>

	<xsl:template name="test3">
		<xsl:call-template name="problem_template">
			<xsl:with-param name="data">
				<xsl:call-template name="get_value"/>
			</xsl:with-param>
		</xsl:call-template>
	</xsl:template>

	<xsl:template name="test4">
		<xsl:variable name="tmp" select="/xmldata"/>
		<xsl:call-template name="problem_template">
			<xsl:with-param name="data" select="$tmp"/>
		</xsl:call-template>
	</xsl:template>

	<xsl:template name="get_value">
		<xsl:value-of select="/xmldata"/>
	</xsl:template>

	<xsl:template name="problem_template">
		<xsl:param name="data"/>
		
		<!-- this is only example to occure warning -->

		<!-- saxon and xsltproc does it without warning -->
		<!-- xalan does it with warning, but result of this expression is OK -->
		<xsl:variable name="var" select="exsl:node-set($data)/* | exsl:node-set($data)
/text()"/>
	</xsl:template>


</xsl:stylesheet>


And xml file:

<?xml version="1.0" encoding="UTF-8"?>
<xmldata>normal <MIDDLE> middle </MIDDLE></xmldata>


TemplateI have an problem with XalanC 1.6 and exsl:node-set function. In some cases, XalanC
returns "XSLT warning: Invalid argument type in EXSLT function node-set()
 source tree node ............". Problem is, that our server component tests returns
from Xalan and when some warning/error occures, component fails.When I use xalan command
line, warnings occures, but result of transformation is OK. Other xslt processors has
no problem with my xslt stylesheet.

Here is an example code:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.
org/common" xmlns:myad="http://www.printsoft.cz/data" xmlns:xsll="http://www.w3.
org/1999/XSL/Transform" xmlns:xslo="http://www.w3.org/1999/XSL/TransformAlias" 
extension-element-prefixes="exsl" version="1.0"> <xsl:param name="LAN"/>
  <xsl:output method="text" indent="yes" encoding="windows-1250"/>

	<xsl:template match="/">

		<!-- OK -->
		<xsl:call-template name="test1"/>

		<!-- WARNING -->
		<xsl:call-template name="test2"/>

		<!-- OK -->
		<xsl:call-template name="test3"/>

		<!-- WARNING -->
		<xsl:call-template name="test4"/>

	</xsl:template>

	<xsl:template name="test1">
		<xsl:variable name="dt">normal <MIDDLE> middle </MIDDLE></xsl:variable>
		<xsl:call-template name="problem_template">
			<xsl:with-param name="data" select="$dt"/>
		</xsl:call-template>
	</xsl:template>

	<xsl:template name="test2">
		<xsl:call-template name="problem_template">
			<xsl:with-param name="data" select="/xmldata"/>
		</xsl:call-template>
	</xsl:template>

	<xsl:template name="test3">
		<xsl:call-template name="problem_template">
			<xsl:with-param name="data">
				<xsl:call-template name="get_value"/>
			</xsl:with-param>
		</xsl:call-template>
	</xsl:template>

	<xsl:template name="test4">
		<xsl:variable name="tmp" select="/xmldata"/>
		<xsl:call-template name="problem_template">
			<xsl:with-param name="data" select="$tmp"/>
		</xsl:call-template>
	</xsl:template>

	<xsl:template name="get_value">
		<xsl:value-of select="/xmldata"/>
	</xsl:template>

	<xsl:template name="problem_template">
		<xsl:param name="data"/>
		
		<!-- this is only example to occure warning -->

		<!-- saxon and xsltproc does it without warning -->
		<!-- xalan does it with warning, but result of this expression is OK -->
		<xsl:variable name="var" select="exsl:node-set($data)/* | exsl:node-set($data)
/text()"/>
	</xsl:template>


</xsl:stylesheet>


And xml file:

<?xml version="1.0" encoding="UTF-8"?>
<xmldata>normal <MIDDLE> middle </MIDDLE></xmldata>


You may comment and uncomment calling of templates test1-4 for better testing.

Thank you.