XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] 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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS