in reply to Re: RFC : XML::Generator::FromDTD
in thread RFC : XML::Generator::FromDTD
Out of interest, how can a DTD help me? What does it bring to the table?
So, before you start writing an XML document, you should consult the corresponding DTD so you know which tags can accept what attributes, and what those attributes should be, which tags need to be empty and so on. When your XML document is parsed, it gets (should get?) validated against whatever DTD is found in the doctype declaration.Unambiguous Structure
XML takes a hard line when it comes to structure. A document should be marked up in such a way that there are no two ways to interpret the names, order and hierarchy of the elements. This vastly resudces errors and code complexity. Programs don't have to take an educated guess or try to fix syntax mistakes the way HTML browsers often do, as there are no surprises of on XML processor creating a different result from another...
The DTD is a blueprint for document structure. An XML schema can restrict the types of data that are allowed to go inside elements...
|
|---|