If you
have the proper tools in your system it is very easy to create the XML
DTD file from an XML document. Most of the leading products that are
used for XML editing will have an inbuilt tool for creating XML DTD
files from the XML document you have loaded in the editor. All you have
to do is to use the tool available in it.
_______________________________________________
When
you generate the DTD file, you might be prompted whether to have the
DTD code externally or internally embedded within the XML document.
If you
choose to have it externally, then a separate DTD file of extension
.dtd is created and a link to that file is added within the XML document.
If internal option is chosen then the code for the DTD is embedded at
the top of the XML document.
This way
of generating the DTD from an XML document helps you to easily generate
a template for your DTD and then use it further to modify it according
to your requirements. Tools like XMLSpy, Exchanger, Cooktop, Xselerator
and many more have this feature for DTD generation.