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]

[xsl] check for ancestors attribute


Subject: [xsl] check for ancestors attribute
From: "Robert Soesemann" <rsoesemann@xxxxxxxxxxx>
Date: Tue, 8 Feb 2005 12:11:34 +0100

How do I need to extend this template to match not only <foo name="bar"> but
further restrict my template to those <foo>s that have an ancestor with
attribute type="general".

<xsl:template match="foo[@name='bar']">

</xsl:template>

I only want to match e.g.
<...>
	...
	<...type="general">
	...
		<foo name="bar">		<<--- match this
		..
		</foo>
	...
	</...>
	...
</...>

It seem to be not OK to write:

<xsl:template match="foo[@name='bar' and ancestor::@type='general']">

</xsl:template>

Can you help?

--
Robert Svsemann
Associate, Technology | Sapient

Kellerstr. 27
81667 M|nchen, Deutschland
Tel.: +49 89/552 987-143
Mobil: +49 162/2773-143
Fax: +49 89/552 987-100
Email: rsoesemann@xxxxxxxxxxx


Current Thread
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