Using CSS Style Sheets (Cascading Style Sheets), you can add additional practical information to the XML document.
-------------------------------------------------- ------------------------------------
Use CSS to display future XML documents What? Should you use CSS to display your future XML documents?
No, we don’t recommend this! But we should still experiment:
This is a small code snippet of an XML document decorated with CSS stylesheets:
<?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>
Even if the display effect using CSS is good, we don’t think using CSS style sheets displaying XML documents is the future trend of web development. We believe that using XSL programs to format XML documents will be the future trend, and currently all major browsers support this technology.
The above is the detailed content of How to use CSS to display XML examples. For more information, please follow other related articles on the PHP Chinese website!