XSL Basics Tutorial Chapter III

Source: Internet
Author: User
Tags xsl client
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> -->



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.