Re: [xml-dev] Convention versus standard

From
Rick Marshall <>
To
Michael Kay <>
Date
2008-07-21T14:23:47Z
ID
<>
Thread
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 
and it seems that libxml from xml.com indeed makes that assumption - 
trying to interpret 00000000000000999900 as an octal (and therefore 
invalid) number. But this definition of a number doesn't allow for the 
0x convention of a hexadecimal number...

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. Which means the above is open to all sorts of 
interpretations - it's natural to a computer, but not a person etc

I'd like to be able to say to our business partners that this is not the 
right way to express a number (in fact they want 99.99 - which is 
another problem and brings the expr function into play) and they should 
drop the leading zeroes.

But I can't do that without the backing of the standards.

Comments? Help?

Thanks
Rick

Michael Kay wrote:
>> It is common practice for programmers to name variables in 
>> numerous non-helpful ways, it is best practice to have a well 
>> thought out naming scheme that allows those who maintain code 
>> to know what a variable is to be used for, hopefully 
>> achievable by following the coding styles for their languages 
>> and organizations
>>     
>
> My experience is that an intelligent programmer using their own common sense
> will usually produce much more helpful variable names than a programmer who
> is blindly following rules defined by some corporate style police.
>
> Michael Kay
> http://www.saxonica.com/
>
>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: 
> subscribe: 
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>