This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: problem with Passing Parameters to Templates
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] problem with Passing Parameters to Templates
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Mon, 22 Jan 2001 16:28:28 GMT
- References: <F152SS7U1Pd1DTM1geT00004070@hotmail.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
> And the xsl file will be something like:
easier if you give complete example
something like:
<z>
<codec>1234</codec>
<desc>5678</desc>
</z>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:call-template name="opt_template">
<xsl:with-param name="node" select="'codec'"/>
</xsl:call-template>
<xsl:call-template name="opt_template">
<xsl:with-param name="node" select="'desc'"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="opt_template">
<xsl:param name="node"></xsl:param>
[<xsl:value-of select=".//*[local-name()=$node]"/>]
</xsl:template>
</xsl:stylesheet>
bash-2.01$ xt codec.xml codec.xsl
<?xml version="1.0" encoding="utf-8"?>
[1234]
[5678]
bash-2.01$
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list