Subject: RE: Testing if an element has an attribute
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Mon, 8 Oct 2001 18:40:01 +0100
|
> Does anyone know how to test if an element has an attribute?
In your case, simplest is <xsl:template match="person[@name]">
> I'm currently trying the following
>
> <xsl:template match="person">
> <xsl:if @name != "">
> // this
> line is causing the problem
It should be <xsl:if test="@name!=''">. Stylesheets must be well-formed XML.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|