-
WWW browsers are lenient about the quality of the
HTML.
-
The XML specification does not allow XML parsers to be
lenient.
-
A correct
document is said to be
well-formed.
-
An XML document that is not
well-formed
must be reported as being in error.
-
An XML document may use a
document type definition
(DTD).
-
The DTD is a sequence of rules describing the markup language.
-
Can appear in the same file as the XML document
or in a separate file.
-
XML that conforms to a DTD is said to be a
valid
document.
-
Even if there is a DTD,
not all parsers check that the XML conforms
to the DTD.
<!ELEMENT consumables (product*)>
<!ELEMENT product (category, item, price)>
<!ELEMENT category (#PCDATA)>
<!ELEMENT item (#PCDATA)>
<!ELEMENT price (#PCDATA)>