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

Re: bohemians, gentry


xslt drop leading zeros

> Is allowed to, but doesn't have to. 

Quite. Is that really how to specify an interoperable language?

In theory Xpath1 processors can drop comments, but in practice they
don't. But Comments are inherantly second class citizens anyway. 0's in
character data are not (or were not until recently)
No Xpath processor is going to drop leading zeros from source
data. If I decide, in my query to use that data as a number then
obviously 01 = 1 but if I want to check starts-with(.,'0' 
then I know it will work.

If I switch to Xpath 2 (and it's a big if) then I no longer get that
assurance, only your "hope" that I'll find processors that don't mess up
my data.


> Only if you applied a schema that said the data type of <Weight> was a
> numeric. If you said it was a string, you'd get back just what you put
> in.

True but I might want to specify it's numeric. for use with a
computational engine and still query the original text with an XMl
querying application.
I might even have specified it's numeric with a facet that insists on
leading zeros. XQuery isn't going to care though, it's still going to
allow implemtations to junk the input string.


> And if you want, you can validate it as a string in your schema then
> cast it to a number when you want to do something numeric with it. You
> don't have to let the data model builder munge it for you.

Yes there are ways round it. I could use Xpath 1 for example.
But why is XPath2 _defined_ to allow this incompatiblity.

It appears to be defined that way so that it can call itself an XML
processing language when really it wants to deal with typed data in a
database which is thinly disguised as XML with an XML view of the data.
I have no objection to people developing a language for handling such
data I do object to them so corrupting XPath/XSLT in order to do it.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

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.