Академический Документы
Профессиональный Документы
Культура Документы
Rey
Gulle
a.) Definitions:
XML DTD
DTD or Document Type Definition. This defines the elements that
may be included in your document, what attributes these elements
have, and the ordering and nesting of the elements.
XML Schema
XML Schemas provide a much more powerful means by which to
define your XML document structure and limitations. XML Schemas are
themselves XML documents. They reference the XML Schema
Namespace, and even have their own DTD.
What XML Schemas do is provide an Object Oriented approach to
defining the format of an XML document. XML Schemas provide a set
of basic types. These types are much wider ranging than the
basic PCDATA and CDATA of DTDs. They include most basic
programming types such as integer, byte, string and floating point
numbers, but they also expand into Internet data types such as ISO
country and language codes (en-GB for example).
b.) Difference
The DTD provides a basic grammar for defining an XML
Document in terms of the metadata that comprise the shape of the
document. An XML Schema provides this, plus a detailed way to define
what the data can and cannot contain. It provides far more control for
the developer over what is legal, and it provides an Object Oriented
approach, with all the benefits this entails.
Firstly, and rather an important point, is that XML Schema is a
new technology. This means that whilst some XML Parsers support it
fully, many still dont. If you use XML to communicate with a legacy
system, perhaps it wont support the XML Schema.
Many systems interfaces are already defined as a DTD. They are
mature definitions, rich and complex. The effort in re-writing the
definition may not be worthwhile.
d.) Examples
XML DTD
XML Schema