This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Testing if an element has an attribute


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]