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

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Namespaces, W3C XML Schema (was Re: ANN: SAX Filters forNamespaceProcessing)





> -----Original Message-----
> From: Elliotte Rusty Harold [mailto:elharo@metalab.unc.edu]
> 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[32], 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.

Matthew