DTD - Validation

We use DTD to describe precisely the XML document. DTDs check the validity of structure and vocabulary of an XML document against the grammatical rules of the appropriate XML language. Now to check the validity of DTD, following procedures can be used −

  • Using XML DTD validation tools − You can use some IDEs such as XML Spy (not free) and XMLStarlet(opensource) can be used to validate XML files against DTD document.

  • Using XML DTD on-line validators − W3C Markup Validation Service is designed to validate Web documents. Use the online validator to check the validaty of your XML DTD here.

  • Write your own XML validators with XML DTD validation API − Newer versions of JDK (above 1.4) support XML DTD validation API. You can write your own validator code to check the validity of XML DTD validation.

Kickstart Your Career

Get certified by completing the course

Get Started