<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=361334409-10052006><FONT face=Arial
color=#0000ff size=2>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!</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=361334409-10052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=361334409-10052006><FONT face=Arial
color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=361334409-10052006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=361334409-10052006><FONT face=Arial
color=#0000ff size=2>Michael Kay</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=361334409-10052006><FONT face=Arial
color=#0000ff size=2>http://www.saxonica.com/</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> jdom-interest-bounces@jdom.org
[mailto:jdom-interest-bounces@jdom.org] <B>On Behalf Of </B>Søren
Faltz<BR><B>Sent:</B> 10 May 2006 10:16<BR><B>To:</B>
jdom-interest@jdom.org<BR><B>Subject:</B> [jdom-interest] Validation
strategy<BR></FONT><BR></DIV>
<DIV></DIV><SPAN class=gmail_quote></SPAN>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.<BR>
<DIV style="DIRECTION: ltr"><BR>When i receive a message, how do I know which
schema to use to validate against?? <BR><BR>my current code is this, and it
works smoothly.<BR><BR><BR>SAXBuilder builder = new SAXBuilder("
org.apache.xerces.parsers.SAXParser ", true);<BR>builder.setFeature("<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://apache.org/xml/features/validation/schema"
target=_blank>http://apache.org/xml/features/validation/schema </A>",
true);<BR>
<BR>builder.setProperty(<BR> "<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"
target=_blank>
http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation</A>",
<BR>
"schema1.xsd");<BR> <BR>//Load the
xml<BR>Document document;<BR>document = builder.build("incoming.xml ");
<BR></DIV></BLOCKQUOTE></BODY></HTML>