[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Namespaces, W3C XML Schema (was Re: ANN: SAX Filters forNamespaceProcessing)
- From: "Fuchs, Matthew" <firstname.lastname@example.org>
- To: 'Elliotte Rusty Harold' <email@example.com>,Xml-Dev <firstname.lastname@example.org>
- Date: Thu, 23 Aug 2001 12:44:29 -0700
> -----Original Message-----
> From: Elliotte Rusty Harold [mailto:email@example.com]
> Sent: Wednesday, August 22, 2001 3:56 PM
> To: Michael Brennan; Xml-Dev
> Subject: RE: Namespaces, W3C XML Schema (was Re: ANN: SAX Filters
> forNames paceProcessing)
> At 1:42 PM -0700 8/22/01, Michael Brennan wrote:
> >> On the other hand, over the last three years as I've taught
> >> developers about DTDs, almost invariably the first question
> >> is "How do I say that an element contains an int?" and the
> >> second question is usually ""How do I say that an element
> >> contains a year since 1969?" or some variant thereof.
> >In other words, people want data-binding, but they want it
> to be simple.
> No, this isn't data binding at all. It's validation. It's
> being presented with a set of quantities and verifying that
> those quantities meet certain predetermined constraints.
> For example, suppose somebody sends me a SOAP request which
> among other things contains a SocialSecurity element whose
> text is supposed to be a social security number. I may want
> to verify that this number contains exactly 11 digits and two
> hyphens before I stick it in my database using JDBC and a
> String variable. This is perfectly reasonable and useful
> thing to do. It in no way requires that I define a
> SocialSecurity class or an ElevenDigitString class or
> anything else that isn't a normal, every day part of Java.
> You may want to do create these classes, and you're free to
> do so, but this is in no way the only way to use schemas.
> Following the same approach, a complex schema might define
> 100s of types. I might pull all of those types into my
> programs from XML documents as the single Java type String. I
> might then turn around and stuff them all in a SQL database
> as INT, DATE, CHAR, and maybe a dozen other standard SQL types.
Or you may choose to exploit using schema types as types and directly
specify the type mappings from schema types to SQL types and not have to
write all that munging code.