Microsoft Word Applied xml a toolkit for Programmers Wiley doc




Download 2,96 Mb.
Pdf ko'rish
bet69/131
Sana14.05.2024
Hajmi2,96 Mb.
#232039
1   ...   65   66   67   68   69   70   71   72   ...   131
Bog'liq
Ceponkus, Hoodbhoy - Applied XML - Toolkit for Programmers

DTD Basics—The How Tos
We now enter the realm of creating XML DTDs. We’ve already mentioned what DTDs 
are, but we haven’t stressed enough yet why they are important.
DTDs are important because they provide a way for explicitly declaring the structure of 
your XML documents. From a programming perspective, dealing with unstructured XML 
is pretty difficult because you can’t really predict what information is going to be coming 
next. Even intuitive structures can take on different forms; for example, in an address 
data set, you may have name, address, and telephone as your fields, but who’s to say 
that address can’t be preceded by telephone? Thus you end up having to create 
programming instances to accommodate as many scenarios as you can to further 
process information. But that solution doesn’t scale well; after all, the permutations of 
markup structures increases exponentially as data sets increase in size and complexity. 
Imagine what a nightmare that would be.
To make things easier, DTDs are a method for explicitly and completely defining the 
structure of a given XML document. DTDs are used by validating parsers that read a 
DTD, interpret the rules dictated within, and rigorously check to see if the XML data 
contained within the document is in conformance with the DTD.


- 66 -
Now we’re ready to take a closer look at what XML DTDs are made of and how to make 
your own custom DTD.
A DTD can consist of the following parts:

Element type declarations

Attribute list declarations

Entity declarations

Notations declarations
Let’s take a more detailed look at each of these declarations and their subsections, which 
we’ve illustrated with many examples for your convenience. If some sound silly, bear with 
us.

Download 2,96 Mb.
1   ...   65   66   67   68   69   70   71   72   ...   131




Download 2,96 Mb.
Pdf ko'rish

Bosh sahifa
Aloqalar

    Bosh sahifa



Microsoft Word Applied xml a toolkit for Programmers Wiley doc

Download 2,96 Mb.
Pdf ko'rish