Lists Home |
Date Index |
Interesting to note, that the early schema-driven mappings such as the SQLXML annotated mapping schemas were designed with the idea in mind that the same XML structure may be bound to different shapes by different people.
But this adds work to the people that need to do the mapping (which I find worthwhile but many programmers don't).
And while I am a big fan of types (being an editor of the XQuery formal semantics and all), I am also a big fan of the ability of XML to be typed by the consumer and not only the producer...
Furthermore, you will quickly run into type mismatches (homonyms and synonyms) if you add a single global, extensible type space. Especially if you allow users to extend that space without a clear way of communicating the semantics of the extension when sending the data. XSD provides you with a mechanism to define new types and communicate them. But even there, you have the problem of versioning and trust (I just overwrite the type definition of your type with the same namespaceURI/localname...). By giving the control and responsibility to the consumer of the data, you acknowledge the brittleness and leave it to the person that needs to care about it.
> -----Original Message-----
> From: Elliotte Harold [mailto:email@example.com]
> Sent: Thursday, October 13, 2005 11:54 AM
> To: Michael Champion
> Cc: XML Developers List
> Subject: Re: [xml-dev] XML-with-datatypes (was....)
> Michael Champion wrote:
> > XSD has few loyal friends in the
> > trenches AFAIK, but the idea of having to deal with the hassles of
> > comparing dates, floats, etc. as strings, or tediously converting them
> > to programming language datatypes one by one, and learning XPath/XSLT
> > in order to handle arbitrary variations in data structure, is even
> > worse. In my heart of hearts I think they would be better off if they
> > *did* learn all this wonderful, open, XML stuff, but the fact seems to
> > be that they would prefer to just map it to objects as quickly as
> > possible. "It's a price in an invoice, don't make me deal with it as
> > a node in a tree!!" is their complaint against untyped XML. By binding
> > to objects, they get the benefits of XML
> > (vendor/platform/application-neutrality, the network effect, etc.)
> > without the costs of diving into all the confusion and complexity that
> > we somewhat happily wallow in.
> This completely misses the point. Weakly typed XML can absolutely be
> bound to objects. The difference is that everyone gets to choose which
> objects to bind to depending on what makes sense to them in their
> environment. Strong typing says everyone has to use the same objects,
> and interpret the dates/floats/integers/etc. in exactly the same way.
> But we aren't the same. We aren't using the same platforms and tools. We
> don't need to do the same things. We all need different, unique classes
> and data structures. XML lets us have that.
> Most data binding frameworks still believe in the Highlander principle
> of schema design (There can be only one!) but a few are starting to move
> in the direction of allowing a lot more local flexibility because
> they've been around long enough to realize that strong, static typing is
> brittle and inflexible; and to see that systems that solve real problems
> need to be a lot more open and flexible. JAXB 2.0 is a big improvement
> on JAXB 1.0 in this respect. Apache Commons Digester is also a very
> interesting approach. Neither is fully there yet, but it's obvious which
> way the tide is flowing.
> Elliotte Rusty Harold firstname.lastname@example.org
> XML in a Nutshell 3rd Edition Just Published!
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> The list archives are at http://lists.xml.org/archives/xml-dev/
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>