This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Ridiculous XPath expression, can I reduce it?
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Ridiculous XPath expression, can I reduce it?
- From: Sebastian Rahtz <sebastian dot rahtz at computing-services dot oxford dot ac dot uk>
- Date: Tue, 3 Apr 2001 12:58:32 +0100
- References: <487B2B5FD092D411977400D0B73EB0A2B3B9@titan.neoworks.co.uk>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Nick Vincent writes:
> I found this XPath expression lurking in some code, and I'm thinking this
> *may well* not be the most efficient way of performing this task, which
> basically finds all the elements that exist below any given <input.form> tag
> but not below an <input.link> tag.
>
> Here is the horror:
>
> .//input.hidden[count(ancestor::input.form[not(@done)])=1 and
> not(@form.prefix) and not(ancestor::input.link)] |
...
using "starts-with(name(.),'input.')" might reduce it somewhat
personally, I'd let all the elements get processed, but add a
<xsl:if test="not(ancester::input.link)">
...
</xsl:if>
condition in the template
Sebastian Rahtz
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list