This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Searching for a particular node
- From: "Arief" <arief at jawasoft dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 25 Mar 2002 18:02:48 +0700
- Subject: Re: [xsl] Searching for a particular node
- References: <27D38451A479D4118CF200B0D03DD2B6023A08BD@localhost>
- Reply-to: xsl-list at lists dot mulberrytech dot com
try this, ... regarding to your xml.
<xsl:template match="entity/contents">
<xsl:apply-templates select="./entity[@id = 'e14']"/>
</xsl:template>
<xsl:template match="contents/entity[@id = 'e14']">
----- Original Message -----
From: "Brian Moynihan" <BMoynihan@orygen.com>
To: <xsl-list@lists.mulberrytech.com>
Sent: Monday, March 25, 2002 5:41 PM
Subject: [xsl] Searching for a particular node
> Hi all,
>
> Is it possible using XSL to select a node based on a particular value ...
> for example in the following xml, I want to select the <entity> node with
an
> id of 'e14'. My question is, how do I accomplish this with XSL using @id?
>
> XSL:
>
> <xsl:template match="tree">
> <xsl:apply-templates select="entity"/>
> </xsl:template>
> <xsl:template match="entity">
>
>
> XML:
>
> <entity id="e12">
> <description>Reports</description>
> <oncontextmenu></oncontextmenu>
> <image>images/book.gif</image>
> <imageOpen>images/bookOpen.gif</imageOpen>
> <contents>
> <entity id="e13">
> <description>Income</description>
> <oncontextmenu></oncontextmenu>
> <image>images/paper.gif</image>
> <imageOpen>images/paper.gif</imageOpen>
> <contents>
> </contents>
> </entity>
> <entity id="e14">
> <description>Expenses</description>
> <oncontextmenu></oncontextmenu>
> <image>images/paper.gif</image>
> <imageOpen>images/paper.gif</imageOpen>
> <contents>
> </contents>
> </entity>
> </contents>
> </entity>
>
> Thanks,
> Brian.
>
>
> **********************************************************************
> Privileged, confidential and/or copyright information may be contained
> in this e-mail. This e-mail is for the use only of the intended
> addressee. If you are not the intended addressee, or the person
> responsible for delivering it to the intended addressee, you may not
> copy, forward, disclose or otherwise use it or any part of it in any
> way whatsoever. To do so is prohibited and may be unlawful.
>
> If you receive this e-mail by mistake please advise the sender
> immediately by using the reply facility in your e-mail software.
>
> Orygen (Ireland) Limited may monitor the content of e-mails sent and
> received via its network for the purposes of ensuring compliance with
> its policies and procedures.
>
> This message is subject to and does not create or vary any contractual
> relationship between Orygen (Ireland) Limited and you.
> **********************************************************************
>
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list