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: Detecting presence of attributes


what u have only checks whether @foo has an attribute or not, it doesn't
tell u whether @foo exists or not, so to test both u'll have to
<xsl:if test="@foo='' or @foo">
hope that helps

-----Original Message-----
From: Peter Flynn [mailto:peter@silmaril.ie]
Sent: Monday, 5 February 2001 9:22 AM
To: XSL-List@lists.mulberrytech.com
Subject: [xsl] Detecting presence of attributes


I'm having a problem with detection of the presence of attributes.
If I say
<xsl:if test="@foo=''"> then I would expect the condition to be true if 
(a) the attribute foo was specified but the value was the null string 
"", or
(b) the attribute foo was not specified at all.

xt does not appear to honor either. Is this a bug in xt, or have 
I missed 
some additional piece of syntax. What I want is the equivalent to 
Omnimark's condition `when attribute foo is specified'.

A second problem arises with the position() function. In xt this appears
only to work within an <xsl:for-each> loop, not in a node group
instantiated by a match or select. Is this a bug or just my misreading?

///Peter








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

 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]