Subject: Re: [xsl] Using XSLT's key() function while context in secondary document? From: Michael Ludwig <mlu@xxxxxxxxxxxxx> Date: Wed, 20 Feb 2008 13:10:08 +0100 |
Alternatively, you could do the same with a little less code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:key name="chnam" match="Chnl" use="@ID" /> <xsl:template match="/"> <Urmel> <xsl:for-each select="key('chnam', document('s.xml')//Channel)"> <p><xsl:value-of select="@ID"/> this works</p> </xsl:for-each> </Urmel> </xsl:template> </xsl:stylesheet>
Thanks a lot, Scott - this is perfectly suited for my purposes and looks much better!
I was wondering whether all those context changes were costly operations but decided it didn't matter enough to bother. Thanks to your help, the context changes are eliminated and the code is lean and clean.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Using XSLT's key() functi, Scott Trenda | Thread | [no subject], Unknown |
Re: [xsl] "Illegal character in aut, Owen Rees | Date | Re: [xsl] Using native XPath in IE , Manfred Staudinger |
Month |