<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"></HEAD><BODY><DIV>Hi,</DIV>
<DIV> </DIV>
<DIV>I went through the FAQ and I found a post explaining how to proceed to
validate the xml instance.</DIV>
<DIV>I ran this code using b8 release and I cannot find a way to find if the doc
is valid once it is built.</DIV>
<DIV>It seems the document is built even if it doesn't comply with the
dtd.</DIV>
<DIV>
<P>Thanks.</P>
<P>Robert</P>
<P> </P></DIV>
<DIV>
<P><FONT face="Arial, Helvetica, sans-serif"><CODE>SAXBuilder builder
=<BR> new SAXBuilder("org.apache.xerces.parsers.SAXParser",
true);<BR>builder.setFeature(<BR>
"http://apache.org/xml/features/validation/schema",
true);<BR>builder.setProperty(<BR> "http://apache.org/xml/properties/schema/external-schemaLocation",<BR> "http://www.w3.org/2001/12/soap-envelope
soap-envelope.xsd" + " "
+<BR> "http://kevinj.develop.com/weblog/weblog.xsd
weblog.xsd");<BR>Document doc = builder.build(xml);</CODE></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif"><CODE>assert (doc.
???)</CODE></FONT></P>
<P><FONT
face="Arial, Helvetica, sans-serif"><CODE></CODE></FONT> </P></DIV></BODY></HTML>