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

RE: Convention versus standard

  • From: "Michael Kay" <mike@s...>
  • To: "'Rick Marshall'" <rjm@z...>
  • Date: Tue, 22 Jul 2008 01:00:39 +0100

RE:  Convention versus standard
> I know this is a back door way to ask what is possibly an 
> xslt question, but it sort of relates here as well.
> 
> The XPATH standards says a number is:
> 
> [30]   Number   ::=   Digits 
> <http://www.w3.org/TR/xpath#NT-Digits> ('.' 
> Digits <http://www.w3.org/TR/xpath#NT-Digits>?)? | '.' Digits 
> <http://www.w3.org/TR/xpath#NT-Digits>
> [31]   Digits   ::=   [0-9]+
> 
> That of course means a Number can start with a '0'.
> 
> Now by convention a number starting with 0 is often 
> interpreted as octal 

Wow, are people still using languages where that applies? In my mind it
ranks with ignoring all characters in columns 1-6 of each line.


and it seems that libxml from xml.com 
> indeed makes that assumption - trying to interpret 
> 00000000000000999900 as an octal

Well, send them a bug report. (Actually, the XPath 1.0 spec doesn't say what
number is represented by the digits "042", or by the digits "42" for that
matter. A lot of people like the fact that the XPath 1.0 spec is so short,
but it achieves its brevity by not saying what it assumes to be obvious.) 

> 
> The standard also mentions that you shouldn't try to 
> interpret an element as a number unless it is a number in the 
> natural language it comes from. 

I think it says exactly the opposite:

NOTE: The number function should not be used for conversion of numeric data
occurring in an element in an XML document unless the element is of a type
that represents numeric data in a language-neutral format (which would
typically be transformed into a language-specific format for presentation to
a user). In addition, the number function cannot be used unless the
language-neutral format used by the element is consistent with the XPath
syntax for a Number.

Michael Kay



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.