This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Need for a technique
- To: terray at 4dconcept dot fr
- Subject: Re: [xsl] Need for a technique
- From: Dimitre Novatchev <dnovatchev at yahoo dot com>
- Date: Tue, 13 Feb 2001 04:53:33 -0800 (PST)
- Cc: xsl-list at lists dot mulberrytech dot com
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Paul,
Use:
ancestor::*[starts-with(name(),'h')][1]
Cheers,
Dimitre Novatchev.
Paul Terray wrote:
Hi everyone,
I need a simple XPath request to look for the following thing :
have the first enclosing element of an element that correspond to
certain
names.
For example :
<doc>
<h1>
<para>my text is here, and <x/> I need to know where x is...</para>
<h2>
<para>However :<list>
<item><x/> this element could be anywhere</item>
</list>
</para>
</h2>
</h1>
</doc>
In this example, I am looking for the nearest enclosing <hx> element
(h1 or
h2).
I need an Xpath expression that would give back h1 for the first <x/>
element, and h2 for the second.
Any idea ?
Thanks.
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list