[jdom-interest] Validation strategy
Søren Faltz
soren.faltz at gmail.com
Wed May 10 04:30:44 PDT 2006
Sorry for the lack of information.
First of all this has to do with JDOM because that's the parser i want to
use.
Each of the 44 message types has a <MessageType>TypeA</MessageType> tag.
So i wont know before i open the message what type it is. And that's bugging
me.
Also the message type is indirectly described in the root element by a
xsi:noNamespaceSchemaLocation="TypeA.xsd" attribute
my code is the following
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",
"TypeA.xsd");
//Load the xml
Document document;
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?
>
> Michael Kay
> http://www.saxonica.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20060510/afc9782d/attachment.htm
More information about the jdom-interest
mailing list