Assuming my xml is as :
<body>Don't forget me this weekend!</body>
<body>I will not</body>
I would like to create dtd/schema for that. Also would like to validate that xml using DOM. Please suggest
The Ranch's own XML FAQ page links to several resources about validating XML via DTD or schema.
Joined: Jan 02, 2012
Thanks for your reply.
Is there any way to validate xml (find missing tags, improper tags, and the special characters) without using any of dtd or xsd.
Please help with java example for the above.
Joined: Sep 21, 2011
Validation implies the presence of some form of schema (DTD, XSD, Relax-NG). But it sounds as if you want to check whether an XML document is wellformed instead. Simply parse the XML and see if an exception happens.