This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: need xpath
- From: "Joerg Heinicke" <joerg dot heinicke at gmx dot de>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 31 Jan 2002 11:59:32 +0100
- Subject: Re: [xsl] need xpath
- References: <001201c1aa44$07c036a0$8bc809c0@ajw>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hello Andrew,
the would be the id()-function, but you need to have a DTD than, which sets
your id-attribute to ID:
<xsl:template match="xref">
<xsl:value-of select="id(@xrefid)/@label"/>
</xsl:template>
The second best method is using keys (possible without DTD):
<xsl:key name="graphics" match="graphic" use="@id"/>
<xsl:template match="xref">
<xsl:value-of select="key('graphics',@xrefid)/@label"/>
</xsl:template>
Regards,
Joerg
----- Original Message -----
From: "Andrew Welch" <andrew@thebristoldirectory.com>
To: <xsl-list@lists.mulberrytech.com>
Sent: Thursday, January 31, 2002 11:42 AM
Subject: [xsl] need xpath
>
> I have the line:
>
> <graphic id="XBWQEF00F" boardno="N0011939.FAX" size="A4" rfa="(Pre
> Mod.02138)" label="2" inschlvl="3" mark="1"/>
>
> And the line:
>
> <xref xrefid="XBWQEF00F"/>
>
> When I encounter the <xref> element I want to output the 'label' attribute
> >from the corresponding graphic element.
>
> Any ideas?
>
> Cheers
>
> andrew
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list