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

Re: string(9) = string(09) ... true or false?

Subject: Re: string(9) = string(09) ... true or false?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 12 Mar 2004 15:25:19 -0500
9 string
Hi Roger,

At 02:52 PM 3/12/2004, you wrote:
I ran this test with SAXON 7_8

<xsl:value-of select="string(9) = string(09)"/>

Output: true

Shouldn't the output be: false?

Mike or Jeni or someone will speak up if there's an XPath 2.0 angle to this (I apologize if that's what you're meaning to ask about) ... but in XPath 1.0, the two expressions are equal, since a number is cast to a string by the rule


if the number is an integer, the number is represented in decimal form as a Number with no decimal point and no leading zeros, preceded by a minus sign (-) if the number is negative [XPath 4.2]

So string(9) is "9", string(09) is "9"; as strings these are equal.


Now "string('9') = string('09')" is false, just as "'9' = '09'" is false (the strings are not the same).

I hope this helps,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


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.