Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

[jdom-interest] Validation strategy

Søren Faltz

2006-05-10

Replies:

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 ");
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.