[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xalan-j-users
Subject:    node-sets with <xsl:with-param>
From:       "Saigal, Ankur" <ankur.saigal () sap ! com>
Date:       2002-04-26 14:40:40
[Download RAW message or body]

Hi, I have the follwing stylesheet,

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
	<xsl:variable name="root" select="/"/>
	<xsl:template match="/">
		<xsl:variable name="map"
select="document('ZACT_STAT.xml')"/>
		<xsl:apply-templates>
			<xsl:with-param name="mapdoc"
select="document('ZACT_STAT.xml')/ZACT_STAT/_-CRMGEC_-ZACT_STAT001"/>
		</xsl:apply-templates>
		
	</xsl:template>
	<xsl:template match="//KTAST">
		<xsl:param name="mapdoc"/>
		<xsl:variable name="val" select="."/>
		<xsl:element name="STAT">
		   <xsl:value-of
select="$mapdoc/KTAST[text()=$val])/ancestor::_-CRMGEC_-ZACT_STAT001/STAT/."
/>
		</xsl:element>
	</xsl:template>
	
</xsl:transform>

It gives me the foolwing error,

	"Left operand of '/' must evaluate to a node-set."

Whereas, if I use

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
	<xsl:variable name="root" select="/"/>
	<xsl:template match="/">
		<xsl:variable name="map"
select="document('ZACT_STAT.xml')"/>
		<xsl:apply-templates/>
		
	</xsl:template>
	<xsl:template match="//KTAST">
		<xsl:param name="mapdoc"/>
		<xsl:variable name="val" select="."/>
		<xsl:element name="STAT">
		   <xsl:value-of
select="document('ZACT_STAT.xml')/ZACT_STAT/_-CRMGEC_-ZACT_STAT001/KTAST[tex
t()=$val])/ancestor::_-CRMGEC_-ZACT_STAT001/STAT/."/>
		</xsl:element>
	</xsl:template>
	
</xsl:transform>

things work as desired,
Does this mean that I am not allowed to pass a node-set with
<xsl:with-param/>

Thanks and Regards,
Ankur

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic