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

Re: Convention versus standard

  • From: Rick Marshall <rjm@z...>
  • To: Michael Kay <mike@s...>
  • Date: Tue, 22 Jul 2008 00:23:47 +1000

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 
[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?


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

fn:Rick  Marshall
org:Zenucom Pty Ltd
tel;cell:+61 411 287 530
	Why buy business software when you can rent it?

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


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.
First Name
Last Name
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.