Pregunta

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.

¿Fue útil?

Solución 3

I found a solution. Validome is a free, online DTD and Schema validator. It does not require me to sign up for any trials, or install any frameworks or other software in order to validate a DTD. Hope this helps someone else. Cheers.

Otros consejos

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top