Extensible Markup Language (XML): XML is a customizable markup language used to describe data. It is similar in structure to HTML. It differs from HTML in that it is used to structure data for processing by applications not to display it. XML allows the creation of elements (tags) specific to any application. Although XML documents can be displayed by a browser, an application program (or JavaScript) is required to interpret it. XML tags define what something is rather than how it looks.

W3C XML

 

Schemas: XML Schemas express shared vocabularies and allow machines to carry out rules made by people. They provide a means for defining the structure, content and semantics of XML documents.

W3C Schema

 

Applications: The strength of XML is that it separates the data from the user interface, making it suitable for a wide range of applications. XML can be used for:

CML OFE MusicML MathML SVG XForms

 

XML Parsers: An XML parser determines the content and structure of an XML document by combining the XML document and its DTD. Internet Explorer 5.0 has a built in XML parser. Amaya is an editor and viewer available from W3C that contains an XML parser. It can render MathML such as the example below (graphic file here).

Amaya

 

Syntax: Correct syntax is more important in XML than in HTML (browsers are forgiving of incorrect HTML but they don't understand XML tags). An XML document begins with the XML declaration<?xml version="1.0"?>. The body is enclosed in a tag, for example <DOCUMENT>, similar to the <HTML> tag. All tags must have matching opening and closing tags, including HTML tags that typically don't (e.g. <IMG>...</IMG> and <BR>...</BR>). Tags must use consistent case. All elements must be properly nested.

<?xml version="1.0"?>
<DOCUMENT>

    ----

</DOCUMENT>

Basic XML Customer 1

 

Document Type Definition (DTD): DTDs are used to define tags and provide information about them. They can be included in an XML file or contained in a separate file (in a manner similar to style sheets). DTDs define how markup tags should be interpreted by the application reading the document. A DTD uses the following syntax: <!ELEMENT name (contents)> where "name" is the name of the element and "contents" describes the type of data that can be included and other elements that can be nested. Although DTDs are not required they ensure data integrity by providing information for the browser to check the XML syntax.

Customer 2 Using DTDs

 

Extensible Hypertext Markup Language (XHTML): XHTML, the next generation markup language, combines HTML and XML. It allows complex documents to be created by combining HTML elements with XML's ability to create new elements. For example an XHTML document could contain HTML elements for images and text and MathML for mathematical notation.

Examples: Following are examples of binding data contained in XML documents to HTML documents. An XML document that exists within an HTML document is called a data island. JavaScriptcan be used to process the data.

Employee1 Employee2 Contacts

 

The layout of XML documents can be defined with Extensible Style Language (XSL) much like CSS defines the layout of an HTML document.

Book Book.css More Books