Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - If DTD is unspecifed XML should not parse >Thread Next - Re: If DTD is unspecifed XML should not parse Re: If DTD is unspecifed XML should not parseTo: NULL Date: 8/1/2007 7:29:00 PM Mithil wrote: > I have a question regarding DTD and XML, is there any way to stop the > parser in parsing the XML file if the DTD is not specified in the > Doctype of the XML file and also throw an error ? I am using java by > the way any help is greatly appreciated. If the DTD is not specified by the document type, validation is not performed and parsing runs normally. If you really insist on rejecting these documents... Depending on the parser and API you're using, you may be able to detect that no DTD has been specified and have your program do something appropriate. If you're using a SAX parser which presents this information, your handler may be able to crash the parser by throwing an exception. Hope that helps. -- () ASCII Ribbon Campaign | Joe Kesselman /\ Stamp out HTML e-mail! | System architexture and kinetic poetry | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
