<!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.00.2919.6307" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=382451223-16022001>neither of these docs is complete, but I would try
removing the file:// part or the url, put it in the same directory as the xml
and run it like that. I would have tried it here but you didn't send
complete documents.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=382451223-16022001></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=382451223-16022001>Really, this is not a JDOM issue btw, it is (probably)
a Xerces issue for you.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=382451223-16022001></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=382451223-16022001>good
luck.</SPAN></FONT></DIV>
<BLOCKQUOTE dir=ltr
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
<DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Peter Bismuti
[mailto:peterb@pssg.com]<BR><B>Sent:</B> Friday, February 16, 2001 3:45
PM<BR><B>To:</B> jdom-interest@jdom.org<BR><B>Subject:</B> Re: [jdom-interest]
verify document with JDom?<BR><BR></DIV></FONT>
<DIV><FONT face=Arial size=2>If I try this code without validation it works
fine, if I turn on validation then it hangs. If I give a bogus URL for
the DTD then it throws an exception. Given this I think my environment
should be OK. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Any ideas on why it would just hang?
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thx</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><?xml version = "1.0"?><BR><!DOCTYPE
creditscore-request SYSTEM "<A
href="file://home/peterb/Gateway/CreditScoreRequest.dtd">file://home/userName/Gateway/CreditScoreRequest.dtd</A>"></FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR><!--Generated by XML
Authority.--><BR><creditscore-request><BR> <!--(agent ,
customer)--><BR> <agent><BR> <!--(agent-code ,
phone-number , email)--><BR> <agent-code issued-by =
"ATT">12345</agent-code><BR> <phone-number type =
"business">4258838888</phone-number><BR> <email>bob@bob.com</email><BR> </agent><BR> <customer
type = "individual"><BR> <!--(name , address , phone-number?
, fax? , mobile? , email? , identifier+ ,
number-of-service)--><BR> <name first-name = "bob"
middle-name = "" last-name = "Jackson" company-name =
""/><BR> <address address1 = "123 redmondway" address2 = ""
city = "redmond" state = "wa" zip = "98052" country =
""/><BR> <phone-number type =
"business">4258838888</phone-number><BR> <fax>4253333333</fax><BR> <mobile>4322223333</mobile><BR> <email>bob@bob.com</email><BR> <identifier
issued-by = "" issue-date = "" expire-date = "" type =
"SSN">432119873</identifier><BR> <number-of-service>5</number-of-service><BR> </customer><BR></creditscore-request><BR></DIV>
<DIV> </DIV>
<DIV><?xml version='1.0' encoding='UTF-8' ?></DIV>
<DIV> </DIV>
<DIV><!--Generated by XML Authority--></DIV>
<DIV> </DIV>
<DIV><!ELEMENT phone-number (#PCDATA)><BR><!ATTLIST
phone-number type CDATA #IMPLIED ><BR><!-- Defines an e-mail
address --><BR><!ELEMENT email (#PCDATA)></DIV>
<DIV> </DIV>
<DIV><!-- root element --><BR><!ELEMENT creditscore-request (agent ,
customer)></DIV>
<DIV> </DIV>
<DIV><!-- agent info--><BR><!ELEMENT agent (agent-code , phone-number
, email)></DIV>
<DIV> </DIV>
<DIV><!ELEMENT agent-code (#PCDATA)></DIV>
<DIV> </DIV>
<DIV><!--define which carrier this code for --><BR><!ATTLIST
agent-code issued-by CDATA #IMPLIED></DIV>
<DIV> </DIV>
<DIV><!ELEMENT customer (name , address , phone-number? , fax? , mobile? ,
email? , identifier+ , number-of-service)><BR><!ATTLIST customer
type CDATA #IMPLIED ><BR><!ELEMENT name EMPTY><BR><!ATTLIST
name first-name CDATA
#IMPLIED<BR>
middle-name CDATA
#IMPLIED<BR>
last-name CDATA
#IMPLIED<BR>
company-name CDATA #IMPLIED ><BR><!-- Defines the elements of a
U.S. address --><BR><!ELEMENT address EMPTY><BR><!ATTLIST
address address1 CDATA
#REQUIRED<BR>
address2 CDATA
#IMPLIED<BR>
city CDATA
#REQUIRED<BR>
state CDATA
#REQUIRED<BR>
zip CDATA
#REQUIRED<BR>
country CDATA #REQUIRED ><BR><!-- Defines a fax number
--><BR><!ELEMENT fax (#PCDATA)></DIV>
<DIV> </DIV>
<DIV><!-- Defines a mobile phone number --><BR><!ELEMENT mobile
(#PCDATA)></DIV>
<DIV> </DIV>
<DIV><!ELEMENT identifier (#PCDATA)><BR><!ATTLIST identifier
issued-by CDATA
#IMPLIED<BR>
issue-date CDATA
#IMPLIED<BR>
expire-date CDATA
#IMPLIED<BR>
type CDATA #IMPLIED
><BR><!ELEMENT number-of-service (#PCDATA)></DIV>
<DIV> </DIV>
<DIV> </DIV></FONT>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A href="mailto:philip.nelson@omniresources.com"
title=philip.nelson@omniresources.com>GB/DEV - Philip Nelson</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
href="mailto:peoter_veliki@hotmail.com"
title=peoter_veliki@hotmail.com>'Peoter Veliki'</A> ; <A
href="mailto:jdom-interest@jdom.org"
title=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 color=#0000ff face=Arial 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="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
<DIV align=left class=OutlookMessageHeader dir=ltr><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="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A href="mailto:philip.nelson@omniresources.com"
title=philip.nelson@omniresources.com>GB/DEV - Philip Nelson</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
href="mailto:jdom-interest@jdom.org"
title=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 color=#0000ff face=Arial 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></BLOCKQUOTE></BODY></HTML>