This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Ridiculous XPath expression, can I reduce it?


Sebastian,

Thanks for your help, the problem with that is that this expression came
from some Java code which goes on to do some advanced fiddling with the
nodes, so I can't use a second level test.

Ta,

Nick

> -----Original Message-----
> From: Sebastian Rahtz
> [mailto:sebastian.rahtz@computing-services.oxford.ac.uk]
> Sent: 03 April 2001 12:59
> To: xsl-list@lists.mulberrytech.com
> Subject: Re: [xsl] Ridiculous XPath expression, can I reduce it?
> 
> 
> 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
> 

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]