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

Reply via email to