[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: need xpath

Subject: RE: need xpath
From: "Andrew Welch" <andrew@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 31 Jan 2002 11:41:17 -0000
top
Thanks Joerg for the example...

at the risk of being flamed badly, it is a requirement that it be written in
wd-xsl (I am modifying a large pre-written stylesheet).  It will be
rewritten in xslt for the next version, but at this time (and for this
deadline) it must stay as wd-xsl.

My wd-xsl knowledge is weak, so if anyone can help me out:

> 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?






-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Joerg
Heinicke
Sent: Thursday, January 31, 2002 11:00 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  need xpath


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@xxxxxxxxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, January 31, 2002 11:42 AM
Subject:  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



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.