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 
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: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>   

begin:vcard
fn:Rick  Marshall
n:Marshall;Rick 
org:Zenucom Pty Ltd
adr:;;;;;;AUSTRALIA
email;internet:rjm@zenucom.com
tel;cell:+61 411 287 530
note;quoted-printable:UNIBASE, FORUM, DENARI, AUTOPAY, UNITE, UNIQUOTE=0D=0A=
	=0D=0A=
	Why buy business software when you can rent it?
x-mozilla-html:TRUE
url:www.zenucom.com
version:2.1
end:vcard



[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