|
Subject: Re: [xsl] xsl:key on variable containing result of apply-templates From: Grainne Reilly <greilly1@xxxxxxxxx> Date: Mon, 25 Nov 2002 12:24:03 -0500 |
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://icl.com/saxon" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl saxon">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:key name="alphabetKey" match="newAlphabet" use="@col"/> <xsl:variable name="alphabet"> <xsl:apply-templates select="/test/alphabetList/alphabet" mode="loadList"/> </xsl:variable> <xsl:variable name="alphabet-exslNodeSet" select="exsl:node-set($alphabet)"/>
<xsl:template match="numbers">
<xsl:for-each select="number">
<xsl:variable name="curPosition" select="position()"/>
<xsl:for-each select="$alphabet-exslNodeSet">
<!-- NB context changed to converted node set -->
<xsl:copy-of select="key('alphabetKey', $curPosition)"/>
</xsl:for-each>
</xsl:for-each>
</xsl:template><xsl:template match="/"> <xsl:apply-templates select="test/numbers"/> </xsl:template>
<xsl:template match="alphabet" mode="loadList">
<newAlphabet col="{@col}"><xsl:value-of select="."/></newAlphabet>
</xsl:template>| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] xsl:key on variable conta, Grainne Reilly | Thread | [xsl] Re: xsl:key on variable conta, Dimitre Novatchev |
| Re: [xsl] Selecting multi-existant , Vasu Chakkera | Date | Re: [xsl] Selecting multi-existant , Joerg Heinicke |
| Month |