OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] W3C Schema: Resistance is Futile, says Don Box

[ Lists Home | Date Index | Thread Index ]

> How does typing something as Notation, as NCName, as gMicrosecondEon, or
> as unsignedLong help me to unpack an XML instance into Java native
> storage without knowledge of semantics?

You're focusing on the wrong kind of types. SOAP toolkits can usually
generate language-specific bindings that make it really easy to read and
write XML. Element declarations bound to complex types become classes.
Locally scoped elements (and attributes) bound to simple types become the
member variables of those classes. The form in which those language-specific
bindings take isn't important and they'll obviously be different for each
language. What's important is that the mapping is automatic and that valid
instances of the types can be parsed and emitted without requiring precious
development time being spent on such low-level details.

A Java-specific binding for an unsignedLong derivative could use BigInteger.
The setter for that field could enforce whatever restrictions were placed on
the simple type in the schema. What's really important to the developer
using this toolkit is that the conversion from XML to the native constructs
supported by his language and back again happen automatically. He didn't
have to type in a single pointy bracket. SAX and the DOM or whatever the
generated code used to parse the XML is completely hidden from him as well.

XSDL is hardly the best language for just validation. DTDs are fine for
that. RELAX NG is even better. Use the right tool for the right job.

Jason







 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS