There aren't any Java API's that I know of that simply validate a DTD by itself. Most DOM parsers have an option to validate a given document against a DTD. Presumably, this validation will fail or at least report a message in your console if the DTD it is validating against is invalid.
http://www.w3schools.com/dtd/dtd_intro.asp
- Saish
I have a DTD file looks like below
<!ELEMENT note (to,from,heading,body)><!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
I want to know whether this DTD file is well formed or not.
I am not using any XML file. I need to prepare and verify my external DTD file.