xsl-list
[Top] [All Lists]

[xsl] First ancestor with a specific attribute

2011-07-01 06:57:05
Hi,

I'm having a blonde moment here and I don't use xslt everyday. I'm
simply trying to get the first ancestor of a node that contains a
specific attribute.

My attempt: select="ancestor::node()[@name!=null]/@name"

Desired effect: return the first ancestor that has a 'name' element.

My bit of xpath returns nothing, even if some of the ancestor nodes
contain a 'name' attribute.

Best,
Jacobus

--~------------------------------------------------------------------
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>