Java Reference
In-Depth Information
standards, such as W3C's XML Schema. In either case, the DTD or schema
specify what tags may be used in the markup, where they may exist with respect
to one another, what attributes tags may have, and how many times a given tag
may appear in a given place. A document can thus be validated—that is,
checked against the corresponding DTD or schema. It's not necessary, however;
in many situations, documents can also be used without validation so long as
they are well-formed —that is, conform to the basic syntax of XML.
HTML, with which even nonprogrammers are familiar, is an instance of
a markup language defined in terms of SGML (and XHTML is its reformula-
tion in terms of XML). This topic itself was written in Docbook, which is
another SGML markup language.
So, if SGML is such a wonder, why is XML all the rage? Well, SGML is
one of those standards that attempt to “subsume the world.” SGML has very
complex and flexible syntax, with many different ways to represent a simple
markup construct. Thus, to completely implement an SGML parser is difficult.
Recognizing that 90% of the complexity of SGML is needed in only about 1%
of cases, the designers of XML realized that they could make a markup specifi-
cation language only 10% as complicated that would cover 99% of cases (of
course, like 85% of statistics, we're making these numbers up, but you get
the point).
Implementing an XML parser, while not exactly trivial, is much easier
than implementing an SGML parser.
SGML/DSSSL and XML/XSLT are efforts to make the transformation
and presentation of hierarchical data easier and more standardized. If what
you have read here is all that you know about XML (or SGML), you should
certainly consider getting yourself a topic on these important standards.
For now, we can say that XML consists of tags which are set off from data
content by the familiar less-than and greater-than brackets we are used to seeing
in HTML:
<samplexmltag>
Just as in HTML, the tags may have start tag and end tag forms:
<samplexmltag>Sample XML tagged data</samplexmltag>
The entire construct, including the pair of matching tags and everything
inside them, is called an element . The start tags may also, like in HTML, carry
data inside them in the form of attributes :
Search WWH ::




Custom Search