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

Re: ancestor

Subject: Re: ancestor
From: "M. David Peterson" <m.david@xxxxxxxxxx>
Date: Mon, 18 Oct 2004 09:02:58 -0700
get ancestor xsl
Your equation says...

select all the 'inlineequation' elements from the document except those whom have an ancestor that has any child whose literal value is equal to the string 'table'.

what you want to say is...

select all the inlineequation elements that do not have an ancestor who local-name() is 'table'.

//inlineequation[not(ancestor::*[local-name() = 'table')]

or better yet just state...

//inlineequation[not(ancestor::table)]

You're right, this is expensive... but without sample XML I can't suggest any optimizations for you. None-the-less, this will get you started down the right path.

Best regards,

<M:D/>

Jiang, Peiyun wrote:
Hi,

I'm trying to get all inlineequation elements that are not in the table
element. The following is not working. I don't know why. I always get all
the inlineequation elements.

select="//inlineequation[not (ancestor::* = 'table')]"

I know this can be very expensive even if it works. What cab be a better way
to do it?

Thanks.

Peiyun Jiang

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.