| Subject: Re: [xsl] Difficulty with document() and for-each scope From: Adam Nielsen <adam.nielsen@xxxxxxxxx> Date: Tue, 17 Jun 2008 10:25:23 +1000 | 
It might be because key() selects only nodes in the document containing the context node, which you've made into the stylesheet itself with your xsl:for-each. So there are no nodes matching /items/item to be selected.
I'm guessing that you are stuck using XSLT 1.0, because you don't need to
do the document('') shenanigans in XSLT 2.0, so the latter's
three-argument version of key() likely won't help.
above-quoted xsl:apply-templates in another xsl:for-each that puts the context node back to the document that you want to process:
<xsl:variable name="item-document" select="/"/> <xsl:for-each select="document('')//me:month"> ... <xsl:for-each select="$item-document"> <xsl:apply-templates select="key('by-month', $month)"> ... </xsl:for-each> </xsl:for-each>
but it's starting to look a tad messy.
Cheers, Adam.
| Current Thread | 
|---|
| 
 | 
| <- Previous | Index | Next -> | 
|---|---|---|
| Re: [xsl] Difficulty with document(, Deborah Pickett | Thread | [xsl] apply-templates vs. call-temp, Greg Fausak | 
| Re: [xsl] Difficulty with document(, Adam Nielsen | Date | RE: [xsl] Check the last character , Pankaj Chaturvedi | 
| Month |