[jdom-interest] Validation strategy
mike at saxonica.com
Wed May 10 05:19:57 PDT 2006
> First of all this has to do with JDOM because that's the parser i want to
But JDOM isn't a parser. It's a document tree model. You invoke a parser
to build the document model. You can insert other things into the pipeline
between parsing and tree construction, for example schema validation.
Each of the 44 message types has a <MessageType>TypeA</MessageType> tag.
Thanks - we got there in the end.
Also the message type is indirectly described in the root element by a
In that case the simplest thing to do is to use Xerces mechanisms to pick up
the appropriate schema, given this schema location. At this point this
certainly has nothing to do with JDOM, and I bow out because it's not my
my code is the following
SAXBuilder builder = new SAXBuilder(" org.apache.xerces.parsers.SAXParser",
//Load the xml
document = builder.build("incoming.xml");
Because I am not using namespaces, it's not possible to add more than one
xsd file in the setProperty method... if i used namespaces, i could add as
many as i wanted to, and then the problem would be solved.
2006/5/10, Michael Kay <mike at saxonica.com>:
> What do you meen by tell the rules for choosing a schema?
You said you have 44 message types. Given a message, how do you know what
type of message it's supposed to be?
Either you distinguish them by the "channel" they arrived on (e.g. the email
address they were sent to or from, or the incoming FTP directory used), or
you distinguish them by content. If you can't do either, then you're stuck.
I'm wondering what all of this has to do with JDOM?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the jdom-interest