This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Need some help with an expression...
- To: xsl-list at mulberrytech dot com
- Subject: Re: Need some help with an expression...
- From: Michal_Mart at cch-lis dot com
- Date: Tue, 22 Aug 2000 15:32:31 -0400
- cc: charles dot douthart at Trifolium dot com
- Reply-To: xsl-list at mulberrytech dot com
Hi Charles,
If I understand what you are asking correctly then this should work:
<xsl:value-of
select="/box/category[@name='someType']/header[self/instance='9']/ref"/>
HTH,
Michal
Charles Douthart <charles.douthart@Trifolium.com> on 08/22/2000 01:11:39 PM
Please respond to xsl-list@mulberrytech.com
To: xsl-list@mulberrytech.com
cc: (bcc: Michal Mart)
Subject: Need some help with an expression...
Hello,
I'm fairly new to XPath and hope that you all can help me with a
problem.
Given an XML structure like the following:
<box>
<category name="someType">
<header>
<self>
<host>myhost</host>
<instance>9</instance>
</self>
<ref>
<host>thathost</host>
<instance>1010101</instance>
</ref>
</header>
And the value of the header instance is 9 (passed from a web page to a
servlet)
What expression can I use to get the ref elemenent under the same header
parent? I undserstand enough to produce
/box/category[@name='someType']/header, but I'm stumped as to how I
should proceed from there. I need to test the value of /self/instance
to find the matching element and then get the ref sibling of the same
header ancestor of the matching element.
TIA,
charles douthart
charles.douthart@trifolium.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list