<!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 5.50.4522.1800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I'm giving that a shot, the problem is that it is
hanging when I try to instantiate a SAXBuilder. Any idea why it would
hang? This program below will never exit.</FONT></DIV><FONT face=Arial
size=2>
<DIV><BR>import java.io.*;<BR>import java.util.*;<BR>import
org.jdom.*;<BR>import org.jdom.input.*;<BR>import org.jdom.output.*;</DIV>
<DIV> </DIV>
<DIV><BR>public class XMLVerify{<BR> public static void main(String
args[]){<BR> String fileName =
"/home/peterb/Gateway/creditscoreRequest.xml";<BR> Document xmlDoc =
buildDoc(fileName);<BR> }</DIV>
<DIV> </DIV>
<DIV> public static Document buildDoc(String
fileName){<BR> try{<BR> // Build the document with
SAX and Xerces, with validation<BR> SAXBuilder builder = new
SAXBuilder(true);<BR> // create and return the
document<BR> return builder.build(new
File(fileName));<BR> }catch(Exception
e){<BR> e.printStackTrace();<BR> return
null;<BR> }<BR> }<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=philip.nelson@omniresources.com
href="mailto:philip.nelson@omniresources.com">GB/DEV - Philip Nelson</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=jdom-interest@jdom.org
href="mailto:jdom-interest@jdom.org">jdom-interest@jdom.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, February 16, 2001 1:11
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [jdom-interest] verify
document with JDom?</DIV>
<DIV><BR></DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=787301421-16022001>When you parse the document, you can have the parser
validate against the DTD. There is not however a method to validate a
JDOM Document instance against a DTD so just use the validate flag on your
builder and you will know you have a valid document coming in.</SPAN></FONT>
</BLOCKQUOTE></BODY></HTML>