Re: [xsl] How do I pass params from <xsl:apply-templates> and receive params from the template?

Subject: Re: [xsl] How do I pass params from <xsl:apply-templates> and receive params from the template?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sun, 03 Oct 2010 13:07:38 +0100
On 03/10/2010 12:54, sudheshna iyer wrote:
<xsl:apply-templates select="document('C:/temp/input2.xml')"/>

That is a URI in an unknown URI scheme "C" Your xml parser may resolve that correctly but if it does it is just being kind, not following any standards, it should be be using the file URI scheme:
file:///C:/temp/input2.xml'


					<xsl:variable name="vOln">
						<xsl:apply-templates select="POOrder">
							<xsl:with-param name="param1"><xsl:value-of select="OLN"/></xsl:with-param>
That defines $param1 to be a document node (/) with a single text node child which is the string value of the OLN child of the current node.
I suspect that you intended
<xsl:with-param name="param1" select="OLN"/>
which defined $param1 to be the OLN eleemnt child of the current node.
<xsl:with-param name="param2">OLN</xsl:with-param>
that defines $param2 to be a document node with a single text node child with string value "OLN", which probably isn't what you want here, but I'm not sure what you intended.
						</xsl:apply-templates>
					</xsl:variable>

<OLN><xsl:value-of select="$vOln"/></OLN>


David

Current Thread