This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Losing xsl:param values within a called template for-each loop
- From: "J.Pietschmann" <j3322ptm at yahoo dot de>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Tue, 14 May 2002 01:30:39 +0200
- Subject: Re: [xsl] Losing xsl:param values within a called template for-each loop
- References: <CF698667C737D41198E50060943F3CF6F681DA@hoexch03.amica.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
CROFT, MICHAEL wrote:
[snip]
Note that you problem is underspecified, or seriously
misspecified. THerefore, i just included enough to make
it work, without consideration on how it could be
adapted to the problem you really have. Use this on
the data you posted to the list only.
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:key name="AlternateId" match="AlternateId"
use="parent::KeyGroup/@id"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="CrfActionGroup"/>
<xsl:template match="partyId">
<xsl:copy>
<xsl:value-of select="key('AlternateId',../KeyGroup/@refid)[last()]/@value"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
J.Pietschmann
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list