XML technologies / XML / XML in a Nutshell / XML on the Web

(Excerpt from "XML in a Nutshell" by Elliotte Rusty Harold & W. Scott Means)

XML began as an attempt to bring the power and structure of SGML to the Web in a form simple enough for nonexperts. Like most major inventions, XML found uses far beyond its creators’ original intentions. In fact, much more XML exists outside the Web than on it. Nevertheless, XML remains an attractive language for writing and serving web pages. Because XML documents must be well-formed and parsers reject malformed documents, XML pages largely avoid troublesome browser incompatibilities. Their strong structure makes them easier for agents to parse. Element and attribute names reflect the content’s nature, helping search engines determine a page’s actual meaning.

XML appears on the Web in three forms. The first is XHTML, an XML-adapted version of HTML 4.0 that tightens HTML to conform to XML syntax. For example, XHTML requires every start-tag to have a corresponding end-tag and every attribute value to be quoted. XHTML also adds a little syntax to HTML, such as the XML declaration and empty-element tags ending with />. With a few exceptions, most XHTML can be displayed in traditional browsers.

The second form is displaying XML documents with arbitrary vocabularies directly in web browsers. Formatting is generally handled either by a CSS stylesheet or an XSLT stylesheet that transforms the document into HTML (possibly XHTML). This requires an XML-capable browser and is unsupported by most older browsers such as Netscape 4.0.

A third possibility is to mix pure XML vocabularies such as MathML and SVG with XHTML using Modular XHTML. Modular XHTML lets you use RDF catalog information, MathML equations, and SVG images in XHTML documents. You can use Namespaces to determine which elements belong to which applications.

  

  

 

 

 

back to top