You will need to implement an EntityResolver class and have that class
know where to find the DTDs. You use setEntityResolver() to tell the
parser what EntityResolver to use. Wendi

"Wineman, Corey J." wrote:
> 
> Hello,
> 
> I am new to XML and have a question about how Xerces does DTD validation
> and locates DTD files. I can't figure out how to tell the parser where
> my DTD is located.
> 
> Say I pass in an XML file with the following content into the parser:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE HTMLFormAdapter SYSTEM "HTMLFormAdapter.dtd">
> 
> <HTMLFormAdapter>
> 
> ...
> 
> </HTMLFormAdapter>
> 
> When I try to parse this file, either with or without validation turned
> on, I get the following error:
> 
> org.xml.sax.SAXParseException: File "HTMLFormAdapter.dtd" not found.
>         at
> org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1219
> 
> I have tried placing the DTD in different places, but I always get the
> same error. How do I tell the parser where to find my DTD files?
> 
> Thanks,
> Corey
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Wendi Sisson
Systems Programmer
International Trade Development
FedEx Services
(901) 263-6695

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to