|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl:key on variable containing result of apply-tem
Thanks Joerg for your reply.
In trying to isolate the problem (and maybe show too much of what I had tried) I was not clear enough that I do a lot of processing, creation of elements, attributes etc. in order to create the node-set I'd like to key on. As a result I cannot use an XPath as the match for the key. My real xml is an XML spreadsheet and you would not like to see the real xslt template :-) So my question remains if it is possible to create a key on the result of apply-templates (using an extension function perhaps)? Since xslt does not permit the use of a variable reference in the match attribute of the xsl:key element, I am less than hopeful that there is. Grainne. >..<snip/>...
> The key declaration must be then:
> <xsl:key name="alphabets" match="alphabet" use="@col"/>
>
> And later the usage of key():
> <xsl:template match="numbers">
> <xsl:for-each select="number">
> <xsl:variable name="curPosition" select="position()"/>
> <xsl:for-each select="$alphabet-exslNodeSet">
> <!-- context changed to converted node set -->
> <xsl:copy-of select="key('myKey', $curPosition)"/>
> </xsl:for-each>
> </xsl:for-each>
></xsl:template>
>...<snip/>...XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








