[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Ridiculous XPath expression, can I reduce it?

Subject: Ridiculous XPath expression, can I reduce it?
From: Nick Vincent <Nick@xxxxxxxxxxxx>
Date: Tue, 3 Apr 2001 12:43:37 +0100
xpath count ancestor
Hi all,

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)] | 
.//input.text[count(ancestor::input.form[not(@done)])=1 and
not(@form.prefix) and not(ancestor::input.link)] |
.//input.textarea[count(ancestor::input.form[not(@done)])=1 and
not(@form.prefix) and not(ancestor::input.link)] |
.//input.radio[count(ancestor::input.form[not(@done)])=1 and
not(@form.prefix) and not(ancestor::input.link)] |
.//input.select[count(ancestor::input.form[not(@done)])=1 and
not(@form.prefix) and not(ancestor::input.link)] |
.//input.dropdown[count(ancestor::input.form[not(@done)])=1 and
not(@form.prefix) and not(ancestor::input.link)] |
.//input.password[count(ancestor::input.form[not(@done)])=1 and
not(@form.prefix) and not(ancestor::input.link)] |
.//input.button[count(ancestor::input.form[not(@done)])=1 and
not(@form.prefix) and not(ancestor::input.link)]

Any help is much appreciated,

Thanks


Nick

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.