xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] First ancestor with a specific attribute


Subject: Re: [xsl] First ancestor with a specific attribute
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Fri, 01 Jul 2011 14:02:55 +0200

Jacobus Reyneke wrote:
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"

XSLT 2.0: select="ancestor::*[exists(@name)][1]/@name"

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



Martin Honnen --- MVP Data Platform Development http://msmvps.com/blogs/martin_honnen/


Current Thread
Keywords
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor