This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: using document() function in match attribute of xsl:keyelement- possible?
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] using document() function in match attribute of xsl:keyelement- possible?
- From: "Swen Thuemmler" <Swen dot Thuemmler at paderlinx dot de>
- Date: Thu, 10 May 2001 18:54:03 +0200 (MET DST)
- cc: Mike McGraw <mmcgraw at 724 dot com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
On Thu, 10 May 2001, Mike McGraw wrote:
[...]
> <xsl:key name="people" match="document('people.xml')/data/person"
> use="@size"/>
>
> and then later in the stylesheet, to display a list of all people who wear
> medium size shirts, I would do this:
>
> <xsl:for-each select="key('people','M')">
> <xsl:value-of select="."/><br/>
> </xsl:for-each>
I believe the correct way is:
<xsl:key name="people" match="/data/person" use="@size"/>
...
<xsl:for-each select="document('people.xml')"> <!-- change context -->
<xsl:for-each select="key('people', 'M')">
<xsl:value-of select="."/><br/>
</xsl:for-each>
</xsl:for-each>
(I did not test this, I might be wrong...)
--Swen
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list