Basic Tutorials
Client XSL
If the browser supports XML, you can use XSL to convert the document into HTML in the browser.
A JavaScript solution
In the previous article, we explained how to convert a document from XML to HTML using XSL. The trick is to add an XSL style sheet to the XML file and have the browser convert it. Even if this method works, including a stylesheet reference in an XML file is not a satisfactory method, and it does not work in browsers that do not support XSL.
A more general approach would be to use a JavaScript to convert from XML to HTML. With one JavaScript, the following possibilities are more likely:
Allow JavaScript to do browser detail testing;
Use a different style sheet based on your browser and user needs.
This is the beauty of XSL. One of the purposes of XSL design is to make it possible to convert data from one format to another, thereby supporting different browsers and different user requirements.
The client XSL transformation will be a major part of the future browser task, and we will see the growth of a specialized browser market, such as Braille, voice networks, network printers, handheld PCs, mobile phones, and so on.
XML files and XSL files
Now look again at the XML document in the previous section:
<?xml version= "1.0"?>
<CATALOG>
<CD>
<title>empire burlesque</title>
<artist>bob dylan</artist>
<COUNTRY> -->