RE: [xsl] possible value-of return values

Subject: RE: [xsl] possible value-of return values
From: "alex reuter" <areuter@xxxxxxxxxxxxxxxx>
Date: Tue, 31 Jul 2001 10:42:12 -0400
Thanks for all your help folks.  I know this may not be the list for this
question, but would anyone know how to programmatically test for the same
set of conditions?  Thanks. alex

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Michael Kay
Sent: Monday, July 30, 2001 6:42 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] possible value-of return values


> Given the following XML document:
> <root>
> <user name="Alex" password="Elephant" color=""/>
> <user name="Reuter" password="Rhino"/>
> </root>
> I was wondering if anyone knew the distinction in return
> values between:
> <xsl:value-of select="/root/user[@name='Alex']/@color"/>
> And
> <xsl:value-of select="/root/user[@name='Reuter']/@color"/>
>
They are both empty strings.

> My guess is they would both be null, but I need to execute logic which
> hinges on whether the attribute exists and has a null value
> OR whether it exists at all.
>
You can test whether the attribute exists:

xsl:if test="/root/user[@name='Alex']/@color"

Mike Kay
Software AG

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread