XML Schema
The
W3C XML Schema Language (schemas
for short, though it’s hardly
the only schema language) addresses
several limitations of DTDs.
First schemas are written in
XML instance document syntax,
using tags, elements, and attributes.
Secondly, schemas are fully
namespace aware. Thirdly, schemas
can assign data types like integer
and date to elements, and validate
documents not only based on
the element structure but also
on the contents of the elements.
With XML schemas, you have more
power to define what valid XML
documents look like.
They have several advantages
over DTDs:
XML schemas use XML syntax.
In other words, an XML schema
is an XML document. That means
you can process a schema just
like any other document. For
example, you can write an XSLT
style sheet that converts an
XML schema into a Web form complete
with automatically generated
JavaScript code that validates
the data as you enter it.
XML schemas support datatypes.
While DTDs do support datatypes,
it's clear those datatypes were
developed from a publishing
perspective. XML schemas support
all of the original datatypes
from DTDs (things like IDs and
ID references).
They also support integers,
floating point numbers, dates,
times, strings, URLs, and other
datatypes useful for data processing
and validation.
XML schemas are extensible.
In addition to the datatypes
defined in the XML schema specification,
you can also create your own,
and you can derive new datatypes
based on other datatypes. |
|
|
|
|