|
Subject: Re: [xsl] Passing a parameter from one matched template to another From: Joerg Heinicke <joerg.heinicke@xxxxxx> Date: Wed, 15 May 2002 01:21:02 +0200 |
<xsl:template match="ARE">
<xsl:param name="x" select="''"/>
<xsl:apply-templates select="following-sibling::*[1]">
<xsl:with-param name="x" select="anything-passed-to-template-YOU"/>
</xsl:apply-templates>
</xsl:template><xsl:template match="YOU">
<xsl:param name="x" select="''"/>
<xsl:apply-templates select="following-sibling::*[1]">
<xsl:with-param name="x" select="anything-passed-to-template-NUTS"/>
</xsl:apply-templates>
</xsl:template><xsl:template match="NUTS"> <xsl:param name="x" select="''"/> </xsl:template>
<xsl:template match="ARE">
<xsl:param name="x" select="''"/>
<xsl:apply-templates>
<xsl:with-param name="x" select="anything-passed-to-template-YOU"/>
</xsl:apply-templates>
</xsl:template><xsl:template match="YOU">
<xsl:param name="x" select="''"/>
<xsl:apply-templates>
<xsl:with-param name="x" select="anything-passed-to-template-NUTS"/>
</xsl:apply-templates>
</xsl:template><xsl:template match="NUTS"> <xsl:param name="x" select="''"/> </xsl:template>
Is it possible to pass a parameter from one matched template to another?
That is, with the following:
<xsl:variable name="input"><ARE><YOU><NUTS></xsl:variable>
<xsl:apply-templates select="vendor:node-set($input)" />
I'd like each template that is matched to pass along a value (as determined by the matched template) to the next template that is matched.
<xsl:template match="ARE"> <xsl:param name="x" select="''"/> <!-- create some value that should be accessed by the next template matched -- in my example, "YOU" --> </xsl:template>
<xsl:template match="YOU"> <xsl:param name="x" select="''"/> <!-- create some value that should be accessed by the next template matched -- in my example, "NUTS" --> </xsl:template>
<xsl:template match="NUTS"> <xsl:param name="x" select="''"/> <!-- whatever --> </xsl:template>
Thanks,
Paul
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] Passing a parameter from , Stuart Celarier | Thread | Re: [xsl] Passing a parameter from , paul morgan |
| RE: [xsl] Passing a parameter from , Stuart Celarier | Date | Re: [xsl] read records from databas, Joerg Heinicke |
| Month |