[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XPath 2.0: Problems with the two boolean constants tru

Subject: XPath 2.0: Problems with the two boolean constants true and false
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Sun, 5 Oct 2003 20:31:15 +0200
xpath date constants
I see two problems with the boolean constants true and false:

  1. They cannot be used in an XPath expression -- cannot be distinguished
from child::true and child::false

  2. boolean('false') is true.  This is especially confusing and may be the
source of many programmers' headaches.

Because of these I chose in my code to use functions returning xs:integer (0
and 1) and for templates to write code like the following:

  <xsl:template name="And" match="*[namespace-uri()='allTrue-And']">
    <xsl:param name="arg1"/>
    <xsl:param name="arg2"/>
         <xsl:value-of select="number(number($arg1) and number($arg2))"/>
  </xsl:template>

Am I wrong? Is there a way to overcome the above problems?


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL




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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.