<!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>Actually, what I said was not quite true. It
doesn't hang if I take out the DOCTYPE statement. If I leave it in, it
will hang with or without validation. </FONT></DIV>
<BLOCKQUOTE dir=ltr
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=peoter_veliki@hotmail.com
href="mailto:peoter_veliki@hotmail.com">'Peoter Veliki'</A> ; <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:37
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [jdom-interest] verify
document with JDom?</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=185453921-16022001>actually, this code works just fine. I caught
an invalid xml (do dtd) and worked with xml with a valid dtd. It must be
a setup issue. As usual, check your classpath, file path etc. and of
course the dreaded "xml parsers in the jre/lib/ext"
directory</SPAN></FONT></DIV>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Peoter Veliki
[mailto:peoter_veliki@hotmail.com]<BR><B>Sent:</B> Friday, February 16, 2001
3:22 PM<BR><B>To:</B> GB/DEV - Philip Nelson; <A
href="mailto:jdom-interest@jdom.org">jdom-interest@jdom.org</A><BR><B>Subject:</B>
Re: [jdom-interest] verify document with JDom?<BR><BR></DIV></FONT>
<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></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>