
a language similar to HTML, but designed for transmitting complex data structures of any type, not just web pages. XML is a subset of
In an XML document, the beginning and end of elements of the document are marked with tags, such as <from> and </from> to mark the beginning and end of the part of a memo that indicates who the memo is from. Note that the notation for tags follows the same format as HTML. However, XML does not define a set of tags as does HTML. Instead, it is extensible because different users can extend the language definition with their own set of tags.
When an XML document uses these tags, a document type definition (DTD) is needed to define the elements. The DTD may be included in the XML document itself, or it may be in a separate document that can be used by all documents in the same document class.
On the following page (page 573) is an example of an XML document that we could use to store data about people we might want to recruit for computer jobs in our company. In this example, the document type definition (DTD) is included at the front of the document.
This example creates a document type called RECRUITLIST, which consists of elements called RECRUITS. Because the DTD contains a plus sign after the declaration of RECRUIT, a document can have one or more recruits. Each RECRUIT can consist of four elements: NAME, ADDRESS, DEGREE, and ACCOMPLISHMENT. Each recruit must have exactly one NAME and one ADDRESS. The asterisk after DEGREE means that a recruit can have zero, one, or more degrees. The element NAME consists of three elements: FIRSTNAME, LASTNAME, and NICKNAME. The question mark after the definition of NICKNAME means that a name may contain zero or one nickname. Following the document type definition, this sample shows two particular recruits.
If we run this document through an XML-validating parser, we can verify that it is a valid XML document. A valid XML document must contain a closing tag for each opening tag, the elements must be correctly nested inside each other, and all of the elements specified in the DTD must be present in the specified sequence. However, the XML parser will not process the data; that must be done with an application designed to work with this type of document. XML is intended for a broad array of applications, including presentation of web documents and storage and transfer of database information. For more information, see www.w3.org/XML.
Industry Associations
XML.org
Seeks to advance worldwide utilization and adoption of XML by providing open and nonprofit industry portal.
Founded: 1999