XML Development Basics - Detailed explanation of using CSS to display XML

黄舟
Release: 2017-03-25 17:05:34
Original
1639 people have browsed it

By using CSS, you can add display information to XML documents.

Use CSS to display your XML?

It is possible to format XML documents using CSS.

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

This is the XML file: CD directory

This is the style sheet: CSS file

Finally, please check the effect: CD directory formatted by CSS file

The following is a fragment of this XML file. The second line, , links this 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>
Copy after login

Comment: Use CSS formatting XML does not represent the future of XML document styling. XML documents should be formatted using the W3C's XSL standard!

The above is the detailed content of XML Development Basics - Detailed explanation of using CSS to display XML. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template