[jdom-interest] Validation strategy

Søren Faltz soren.faltz at gmail.com
Wed May 10 02:15:56 PDT 2006


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
against??

my current code is this, and it works smoothly.


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

builder.setProperty(
    "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",

    "schema1.xsd");

//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/fa5ea5be/attachment.htm


More information about the jdom-interest mailing list