aspose file tools*
The moose likes XML and Related Technologies and the fly likes Referring to DTD in XML File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Referring to DTD in XML File" Watch "Referring to DTD in XML File" New topic
Author

Referring to DTD in XML File

Siddharth Bhargava
Ranch Hand

Joined: Feb 23, 2007
Posts: 248
Hi Friends,
I had written a small program to validate an XML using a DTD. When I am referring to the DTD in the XML file its giving an error. I learned that we can refer to the DTD in the XML file in 2 ways. The first way is working fine while the second way is not working as expected. I want to make my concepts clear so I want to learn to refer the DTD using both the ways. Please do find the code snippet below :



Please do help me in clearing my concepts. Please do explain me why I am getting an exception in the second case. As I understand both the methods should work.

Thanks and Regards,
Sid.
Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1051

FileNotFoundException is thrown when JVM tries to open a file denoted by a specified pathname doesnot exist or failed to open..

I donot understand you complete problem but as per my understanding i can see the
in your error message it says..


java.io.FileNotFoundException:
http://abc.go.com/Employee.dtd



But above in your code it says..




So may be you are referring to a wrong path..



SCJP6.0,My blog Ranchers from Delhi
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Referring to DTD in XML File
 
Similar Threads
question on mock exam
Merging siblings with same tag name in xml documents
About parsing with DOM ...
question on mock exam
DTD Validation problem via Sax