Subject: Re: [xsl] Select parent node From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx> Date: Mon, 26 Jul 2004 14:14:55 +0100 |
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.Claeys@xxxxxxxxxxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> 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. > **************************************************************************** *********************
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Select parent node, David Carlisle | Thread | [xsl] New XPath 2.0 drafts, Michael Kay |
Re: [xsl] using exsl:node-set(), M. David Peterson | Date | Re: [xsl] Can one Use JavaScript to, Vasu Chakkera |
Month |