Displaying XML on the web

Extensible Stylesheet Language (XSL) is a supporting technology that describes how to format or transform the data in an XML document. The document is changed to a format suitable for browser display. The process is similar to applying a CSS to an HTML document for rendering.

Without using CSS or XSL, a generic XML document is rendered differently in different web browsers. Browsers like Internet Explorer and Mozilla allow viewing of generic XML document similar to directory structure, e.g. expanding or collapsing a subtree. In order to allow CSS styling, the XML document must include a special reference to a style sheet:

<?xml-stylesheet type="text/css" href="/myStyleSheet.css"?>
This is different from the HTML way to apply a stylesheet, which uses the element.

For XSL Transformations (XSLT), this is also very similar:

<?xml-stylesheet type="text/xsl" href="/transform.xsl"?>
Client-side XSLT is not supported in Opera.

While browser-based XML rendering develops, the alternative is conversion into HTML or PDF or other formats on the server. Programs like Cocoon process an XML file against a stylesheet (and can perform other processing as well) and send the output back to the user's browser without the user needing to be aware of what has been going on in the background.


Read about Software Converter Features.

Go to glossary contents