Generating
DTD from XML document
Tools
like XMLSpy, Xselerator, Exchanger, Cooktop, StylusStudio and many more
have an inbuilt tool for generating DTD document from the XML document.To
use the tool you have to open the XML document for which you need to
generate DTD. Check the well-formedness of the document and then use
that tool to generate DTD from the XML document.
_______________________________________________
_______________________________________________
Such
a generated DTD document can be used as a template and further modifications
to the DTD can be done if needed to fine tune it. This is the easiest
way to get a DTD instead of writing from the scratch.
When
you generate the DTD, you might be prompted, whether to have the DTD
embedded within the XML document or to have it separately in an external
file. If you choose to have it in an external file then a link to that
external file is added at the top of the XML document automatically.