prev
next
eXtensible Markup Language (XML)
Syntax:
-
XML is a tagged, structured language like HTML. However, in XML,
the tags are not predefined (with a very few exceptions). Users are
free to define whatever tags are appropriate for their applications.
XML is a tagged, structured language, designed to deliver data in
application specific structures.
-
Example: xmlEx1.xml
An example of basic XML document structure.
-
There are two correctness issues for an XML document:
-
is it well formed? That is, does it satisfy the basic rules of
syntax for an XML document?
-
is it valid? That is, is it a valid element of a set of XML
documents defined by rules established by the designer?
-
For this second case, there are two ways of establishing the
rules for validation - through a Document Type Definition (DTD),
or using a Schema.
-
DTDs have been around a long time. HTML is, for example, defined
by a DTD. DTDs are tagged, structured documents themselves, but
their language and structure do not conform to the rules of XML.
-
Schemas, on the other hand, are much newer. A final specification
is about to be ratified by W3C. Schemas are themselves valid XML
documents, and are expected to become the method of choice for
specifying XML document classes.
-
Schemas would be used to:
-
verify that a document satisfies the rules of its parent class
before being placed on a web server for distribution.
-
verify that data obtained from some new site conforms to the
class you need for your application.
-
provide documentation, in human readable form, for data served
to some application. The application could, in fact, base its
help system on information contained in the schema.
prev
next