xsl-list
[Top] [All Lists]

RE: match all attributes except @foo

2004-04-09 01:46:46

I currently have this inside an <xsl:copy>:

            <xsl:apply-templates select="node() | @*" />

The second branch of that union selects all attributes.  I want to 
change it so that it matches all attributes except for the attribute 
'foo'.

IOW, my <xsl:copy> should filter out @foo.  How do I do it?


You can write @*[name() != 'foo']. In XSLT 2.0 you can write (@* except
@foo). But a better way is perhaps to declare a template rule for @foo that
does nothing:

<xsl:template match="@foo" priority="3"/>

Michael Kay



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