xsl-list
[Top] [All Lists]

Re: Select parent node

2004-07-26 06:14:55
you could do this is in a couple of ways..

do
select="icon[icon_nr = 2]/@id"
select="icon[icon_nr = 2]/icon_title"

or
Define a key..and use it..
like

<xsl:key match = "/icon" name = "icons" use = "icon_nr"/>
as a child of the xsl:stylesheet


and then in your template,
use
select="key('icons',1)/@id"
select="key('icons',2)/icon_title"

Vasu



----- Original Message ----- 
From: "Bart Claeys" <Bart(_dot_)Claeys(_at_)sportpaleis(_dot_)be>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Monday, July 26, 2004 9:58 AM
Subject: [xsl] Select parent node


Hi there!

I've got this, (probably simple) question selecting only one specific
node. Consider the following XML structure, how can I
retrieve the values of the node where icon_nr = 2. I want to retrieve the
icon's ID and the icon_title.

<icon id="2343">
<icon_nr>1</icon_nr>
<icon_title>Yesterday</icon_title>
</icon>
<icon id="3432">
<icon_nr>2</icon_nr>
<icon_title>Today</icon_title>
</icon>
<icon id="1023">
<icon_nr>3</icon_nr>
<icon_title>Tomorrow</icon_title>
</icon>


Thanks a lot!
Grtz, Bart

****************************************************************************
*********************
The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager
or
the sender immediately.
Do not disclose the contents to anyone nor make copies of this mail.

****************************************************************************
*********************


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--




<Prev in Thread] Current Thread [Next in Thread>