|
|
Q1324 What is the advantage of having DTD in an xml document?
irt.org | Knowledge Base | XML | Q1324 [ previous next ] Q1324 What is the advantage of having DTD in an xml document?The reason why you want to include DTD's in XML documents, is that the DTD is a vocabulary of the XML elements that you use. For example consider the below simple XML document:
In this case the DTD would contain the following elements: product, description, size, and prize The DTD then lets you do validation in your XML document (are you using 'allowed' elements), and it also describes what kind of element for example the price element is (e.g. is it PCDATA?). Last, but not least, there is currently work going on at the W3C on schemas, which is planned to replace DTD's in the near future. |
-- div -->
|