Re: [xsl] Not So Newbie XPath Question

Subject: Re: [xsl] Not So Newbie XPath Question
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Mon, 19 Feb 2001 14:03:51 +0000
Hi Bernard,

> Amongst the child elements there is a sequence of zero or more "a"
> elements. I need an XPath expression to select/match the first
> element after this sequence of "a" elements(if present). The first
> element's name after the "a" sequence is unknown. In the above
> example it just happens to be "xp"

It depends if you're selecting or matching.  If you're selecting, then
you can say:

go to the z element:


from there go to the a elements:


and from there to any immediately following sibling...


that isn't itself an 'a' element:


This will only work in a select expression because match patterns
don't allow following-sibling:: axes.  For a match pattern, you need
something like you have already or one of its equivalents, like:

  z/*[preceding-sibling::a and not(self::a)][1]


I hope that helps,


Jeni Tennison

 XSL-List info and archive:

Current Thread