This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Fwd: complex XPATH test
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: Fwd: [xsl] complex XPATH test
- From: Adam Van Den Hoven <Adam dot Hoven at bluezone dot net>
- Date: Wed, 18 Jul 2001 09:15:20 -0700
- Reply-To: xsl-list at lists dot mulberrytech dot com
I came up with the following scheme that doesn't seem to have any
dependancies on for-each:
<xsl:variable name="ancestorblock" select="(ancestor::p|... all the
rest of them)[last()]" />
<xsl:if
test="boolean(generate-id($ancestorblock/descendant::node()[last()]) !=
generate-id(current()))">
<br/>
</xsl:if>
That seems to work OK for me. Now I'll grant that I've tweaked it a bit, I
had forgotten you could apply a predicate to (p | h2), but that seems to be
the best possible solution since you aren't doing any loopeing or counting.
Its also short.
Thanks for your help.
Adam
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list