hagus sez :
Out of interest, how can a DTD help me? What does it bring to the table?
I'll quote from the introduction to
Learning XML, since it's got a good concise explanation :
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...
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.
My hope was that, by creating a module that created an object whose methods complied to (or mostly to, I wanted to run it by pm first and see if the idea was viable) a DTD, I could
time & effort debugging later on down the road.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.