[jdom-interest] JDOM in memory schema validation

Bradley S. Huffman hip at a.cs.okstate.edu
Tue Apr 1 18:53:53 PST 2003


Jason Hunter writes:

> > > I've seen you are planning to implement in memory schema validation for
> > > JDOM which would be a quite cool feature.
> > 
> > I was interested in this at one time, but other that in a XML editor, I
> > think some type of data-binding scheme would work better, so I lost interes
> t.
> > But if someone has a really cool use case my interest could be peeked again
> .
> 
> The argument for this feature is that when you receive a document across
> the network in a B2B environment, you'll naturally want to check the
> document conforms to a particular schema.  Parsing with validation
> turned on is NOT good enough because it only checks the doc against the
> schema declared within the document.  It's like virus checking a program
> based on an algorithm declared within the program.  No thanks!
> 
> So what you want to do is take a doc, take a schema or DTD or set of
> schemas, and ask if the received doc complies against the locally held
> data.  Ignore schema decls or doc types within the doc.

Understand that, but if you have a schema and your dealing with data, 
wouldn't it be better to use something like JAXB and let the validation be
done by the unmarshalling process, then just use the objects, and skip
dealing with elements, attributes, and strings all together.

Brad



More information about the jdom-interest mailing list