xsl-list
[Top] [All Lists]

Re: ancestor

2004-10-18 09:02:58
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

--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--



<Prev in Thread] Current Thread [Next in Thread>