[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] DOCTYPE causes appearance of unwanted attributes


Subject: RE: [xsl] DOCTYPE causes appearance of unwanted attributes
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Tue, 6 Apr 2004 22:23:15 +0100

> Eliot Kimber wrote:
> > You can always write your own DTD-specific attribute filter, e.g.:
> > 
> > <xsl:template match="@*">
> >   <xsl:choose>
> >    <xsl:when test="self::attname_1 and
> >                    string(.) = 'default_value'"/>
> 
> I wasn't thinking clearly--the above test is not valid syntax as you 
> can't use self:: for attributes. A correct solution is:
> 

But a better solution (which always suggests itself when you see xsl:choose
immediately within xsl:template) is

<xsl:template match="@attname_1[.='default_value]"/>

Michael Kay


Current Thread