What resources are available to validate a DTD? I want to be clear: I am not talking about validating XML documents against a DTD.
I am talking about making sure that the DTD itself is valid.
To do this you can load the . dtd file in eclipse (copy it into a project, or point your project towards your dtd file). Then in the file navigator in eclipse, you can right click on the dtd, then click validate.
An XML document with correct syntax is called "Well Formed". An XML document validated against a DTD is both "Well Formed" and "Valid".
The purpose of a DTD is to define the legal building blocks of an XML document. It defines the document structure with a list of legal elements. A DTD can be declared inline in your XML document, or as an external reference.
You are able to validate DTD files using the eclipse java IDE. I realise it is not a lightweight solution, however I found it useful whilst working with DTDs which would eventually be compiled to Java classes via xjc.
To do this you can load the .dtd file in eclipse (copy it into a project, or point your project towards your dtd file). Then in the file navigator in eclipse, you can right click on the dtd, then click validate.
For documentation see the Eclipse official website
I work with Oxygen xml editor, you can try for 30 day trial!
Works very well with xml files, dtd, xslt...
When you write DTD code you can validate it (document menu > validate).
The dtd file is an xml file which describe a xml file.
This code:
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT chapter (title, paragraph)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT paragraph (#PCDATA)>
are valid. This code:
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT chapter (title, paragraph)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT paragraph (strong)>
give an alert. hope it work for you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With