[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Conditional expressions using optional attributes/
Aleksei, Thanks. It works fine now. William. -----Original Message----- From: Aleksei Valikov [mailto:valikov@xxxxxx] Sent: Monday, August 13, 2001 9:48 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: Conditional expressions using optional attributes/elements Hi. > Problem 1: > <xsl:if test="@enabled != 'false' and @override != 'false'"> > <!-- do something --> > </xsl:if> > But if the attributes are not defined, it doesn't act as expected. Try not(@enabled='false') and not(@override='false') See the definitions of equality expressions with node-sets. You'll understand why a != b is not the same as not(a=b) > I have an element which has optional *elements*, and I want to test the > values of attributes of these elements. Here's the DTD: > <xsl:if test="enabled/@value != 'false' and override/@value != 'false'"> > <!-- do something --> > </xsl:if> > But if the *elements* are not defined, it doesn't act as expected. The same - use not(enabled/@value = 'false'). Bye. /lexi XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|