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

Re: XML-with-datatypes -- a sketch proposal


xmldt
Vladimir Gapeyev wrote:
> 
> On Thu, 13 Oct 2005, Mail wrote:
> 
>> However, I don't think it is really that hard to extend XML further to 
>> make it strong typed. XML was initially designed without Namespace, 
>> and it is now patched with namespace and everyone is happy to accept it.

I second Amelia's laughter on this point.

> I think you idea of introducing datatypes as an add-on similar to 
> namespaces (or xml:ID) can be carried out by adding a bit more semantics 
> to the xsi:type attribute, and moving it from WXS to XML Core.  An 
> important thing, I believe, would be to provide a framework for defining 
> datatype identifiers and declaring them on document nodes, but to leave 
> actual definitions of the datatype identifiers, lexical and semantic 
> spaces, outside the specification and in the hands of the users and 
> organized user groups.

There's a complexity cost to any addition to the core. Even if the 
proposal were all advantage and no disadvantage, it still might well not 
be worth it. So far I don't see a compelling benefit to doing this.

> E.g. here is an example of a document that conforms to the hypothetical 
> XML-with-datatypes:
> 
> <?xml version='1.0'?>
> <order  xmldt:currency="my:banks:currency:format"
>         xmldt:date="http://www.w3.org/2001/XMLSchema/date"
>         xmldt:text="http://www.standardsbody.org/xmld/1.0/pcdata"

This document is namespace malformed. You need to declare the xmldt prefix.


> - The document above is XML-conformant.

But not namespace conformant

> - The xmldt attribute is reserved by the "Datatype definitions for XML" 
> specification.

It's not an attribute. It's a namespace prefix. Reserving these is 
*BAD*. URIs matter. Prefixes don't. That's at the heart of namespaces. 
That xml: is an exception is grandfathered in, and this causes major 
problems for implementations.


> - In the root element, xmldt binds datatype URIs to short names. The 
> URIs, as well as lexical and semantic spaces for values of the 
> corresponding datatypes, are defined by user groups, or just agreed upon 
> between two
> developers.

Why does this need to go into the core then? Why do such agreements need 
a separate lexical space/ What's wrong with GIs?

> - On elements that carry datatype values, xmldt declares the datatype, 
> by referring to a short name.

names would need to be prefixed and namespace qualified.

> - A conformant XML processor checks that all referenced types are 
> declared, and passes information about the type to the application 
> whenever a typed node is encountered.

Why would I want to do this? Most of the time I don't validate already.


> Notes / Questions:
> 
> - It is possible for a conformant processor to pass the type information 
> to the application by returning a parsed semantic value instead its raw 
> lexical text -- according to the conventions established between the 
> processor and the application.

Not in any current API; and probably not in any API if the type system 
is extensible. I once tried to design a new version of SAX that could do 
this just with schema types. I couldn't figure out how.

> - This offers datatypes only for elements, but not for attributes.  Is 
> this a big disadvantage?

Only in so far as types matter at all.

> - I suspect that the effect of this proposal can be achieved today via 
> WXS xsi:type or notations, but this would still require one to use 
> schemas, even in a project where the requirement is just to know 
> datatypes at the leaves, but process the tree structure dynamically.  Is 
> such a requirement uncommon?

You can use xsi:type without pulling in a schema.

-- 
Elliotte Rusty Harold  elharo@m...
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim

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.