This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
suppose i have written java code for reading xml file.and xml file is created by some one else , then is that xml file checked against dtd automatically .so that i could not get error at run time or have i need to write some code for checking against dtd before parsing the java file.
The parser uses the DOCTYPE definition in the xml file to first determine whether the document has an associated DTD. If so, and if the validation is turned on, the parser automatically "parses the dtd" and then esures that the XML conforms to the DTD structure. Hope that answers your question.
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Joined: Apr 03, 2002
thanks for reply i got error by using following methods setValidating(true); setErrorHandler(some class); but now i want to check wheather the value in xml file is single byte or double byte how should i write the schema file
Sorry to post in the old thread.But my question is a continuation.
If a DTD is defined and if you have say "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd", how does the parser checks if i do not have an internet connection in my pc? Does that works that way?
Could you please tell me how the DTD is validated by any parser?