Subject: RE: [xsl] possible value-of return values From: "Michael Kay" <mhkay@xxxxxxxxxxxx> Date: Mon, 30 Jul 2001 23:41:59 +0100 |
> 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] possible value-of return , Trevor Nash | Thread | RE: [xsl] possible value-of return , alex reuter |
RE: [xsl] : Escaping '&' in an HTML, Aparna Joshi | Date | [xsl] two columns in a table from o, Matthew Smith |
Month |