<!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><FONT face=Arial color=#0000ff size=2></FONT>
<DIV dir=ltr align=left><BR><SPAN class=127461512-10052006><FONT face=Arial 
color=#0000ff size=2>&nbsp;&gt;&nbsp;</FONT></SPAN>First of all this has to do 
with JDOM because that's the parser i want to use.&nbsp;<SPAN 
class=127461512-10052006><FONT face=Arial color=#0000ff 
size=2>&nbsp;</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=127461512-10052006>&nbsp;</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=127461512-10052006></SPAN><SPAN 
class=127461512-10052006><FONT face=Arial color=#0000ff size=2>&nbsp;But JDOM 
isn't a parser. It's a document tree model. &nbsp;You invoke a parser to build 
the document model. You can insert other things into the pipeline between 
parsing and tree construction, for example schema 
validation.</FONT></SPAN><BR><BR>Each of the 44 message types has a 
&lt;MessageType&gt;TypeA&lt;/MessageType&gt; tag.<BR><BR><SPAN 
class=127461512-10052006><FONT face=Arial color=#0000ff size=2>&nbsp;Thanks 
-&nbsp;we got there in the end.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=127461512-10052006>&nbsp;</SPAN><BR>Also the 
message type is indirectly described in the root element by a 
xsi:noNamespaceSchemaLocation="TypeA.xsd" attribute<SPAN 
class=127461512-10052006><FONT face=Arial color=#0000ff 
size=2>&nbsp;</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=127461512-10052006></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=127461512-10052006><FONT face=Arial 
color=#0000ff size=2>In that case the simplest thing to do is to use Xerces 
mechanisms to pick up the appropriate schema, given this schema location. At 
this&nbsp;point this certainly has nothing to do with JDOM, and I bow out 
because it's not my area.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=127461512-10052006></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=127461512-10052006><FONT face=Arial 
color=#0000ff size=2>Michael Kay</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=127461512-10052006><FONT face=Arial 
color=#0000ff size=2><A 
href="http://www.saxonica.com/">http://www.saxonica.com/</A></FONT>&nbsp;</SPAN><BR><BR>my 
code is the following<BR><BR>SAXBuilder builder = new SAXBuilder(" 
org.apache.xerces.parsers.SAXParser", 
true);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>builder.setFeature("<A 
href="http://apache.org/xml/features/validation/schema">http://apache.org/xml/features/validation/schema</A>", 
true);<BR>builder.setProperty 
(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"<A 
href="http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation">http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation</A>",&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
" TypeA.xsd");<BR><BR>//Load the 
xml<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Document 
document;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document = 
builder.build("incoming.xml");<BR><BR>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. <BR><BR><BR></DIV>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV><SPAN class=gmail_quote>2006/5/10, Michael Kay &lt;<A 
  href="mailto:mike@saxonica.com">mike@saxonica.com</A>&gt;:</SPAN>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
    <DIV style="DIRECTION: ltr"><SPAN class=q>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2>&nbsp;&gt;&nbsp;</FONT></SPAN>What do you meen by tell the rules for 
    choosing a schema?&nbsp;<BR><SPAN><FONT face=Arial color=#0000ff 
    size=2>&nbsp;</FONT></SPAN></DIV></SPAN></DIV>
    <DIV style="DIRECTION: ltr">
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>You said 
    you have 44 message types. Given a message, how do you know what type of 
    message it's supposed to be?</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>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.</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>I'm 
    wondering what all of this has to do with JDOM?</FONT></SPAN></DIV></DIV>
    <DIV style="DIRECTION: ltr"><SPAN class=e id=q_10b1e029fb30d59c_2>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>Michael 
    Kay</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2><A 
    onclick="return top.js.OpenExtLink(window,event,this)" 
    href="http://www.saxonica.com/" 
    target=_blank>http://www.saxonica.com/</A></FONT></SPAN> 
  </DIV></SPAN></DIV></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></BODY></HTML>