displaying XML using CSS

Source: Internet
Author: User
displaying XML using CSS

By using CSS (cascading style Sheets cascading style sheets), you can add display information to an XML document. use CSS to display your XML.

It is possible to use CSS to format an XML document.

The following example is about how to format an XML document using a CSS style sheet:

Take a look at this XML file: CD directory

Then look at this style sheet: CSS files

Finally, see: CD directories formatted with CSS files

Here is a small part of the XML file. The second line links the XML file to the CSS file: <?xml version= "1.0" encoding= "Iso-8859-1"?>
<?xml-stylesheet type= "Text/css" href= "Cd_catalog.css"?>
<CATALOG>
<CD>
<title>empire burlesque</title>
<artist>bob dylan</artist>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
<CD>
<title>hide your heart</title>
<artist>bonnie tyler</artist>
<COUNTRY>UK</COUNTRY>
<company>cbs records</company>
<PRICE>9.90</PRICE>
<YEAR>1988</YEAR>
</CD>
.
.
.
</CATALOG>

Formatting XML using CSS is not a common method.

It is recommended to use XSLT, see the next chapter.

Related Article

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.