[jdom-interest] Validation strategy

Michael Kay mike at saxonica.com
Wed May 10 02:48:15 PDT 2006

It rather depends how the messages are distinguished. If they are all in
disjoint namespaces, you could simply write a superschema that imports all
the others, and then do strict validation against that. If the schemas have
overlapping definitions, it's a bit more complicated. But if you can't tell
us the rules for choosing a schema, then no-one else can!
The fact that you are asking on a JDOM list also suggests that you have made
some decisions about the processing pipeline, and these decisions may
constrain the answer.
Michael Kay


From: jdom-interest-bounces at jdom.org [mailto:jdom-interest-bounces at jdom.org]
On Behalf Of Søren Faltz
Sent: 10 May 2006 10:16
To: jdom-interest at jdom.org
Subject: [jdom-interest] Validation strategy

I receive messages in the form of an XML document. I am able to receive up
to 44 different messages, and i therefor also have 44 different xml schemas.

When i receive a message, how do I know which schema to use to validate

my current code is this, and it works smoothly.

SAXBuilder builder = new SAXBuilder(" org.apache.xerces.parsers.SAXParser ",
<http://apache.org/xml/features/validation/schema> ", true);

//Load the xml
Document document;
document = builder.build("incoming.xml "); 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20060510/31a34276/attachment.htm

More information about the jdom-interest mailing list