xsl-list
[Top] [All Lists]

check for ancestors attribute

2005-02-08 04:11:34
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[(_at_)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[(_at_)name='bar' and ancestor::@type='general']">

</xsl:template>

Can you help?

--
Robert Sösemann 
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(_at_)sapient(_dot_)com 

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