Extensible Style Language (XSL)
The Extensible Style Language (XSL) is an extremely capable
(and complicated) language that can select data from an XML
file and prepare it for presentation in HTML.
|
Extensible Style Language: events5.xsl
|
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<body>
<table cellspacing="0" width="100%">
<tr>
<td align="center" bgcolor="#ccccff">
<b>Drama At The UW</b>
</td>
</tr>
</table>
<xsl:for-each select="events/play">
<p>
<b><xsl:value-of select="title"/></b>
by <xsl:value-of select="author/First_Name"/>
<xsl:value-of select="author/Last_Name"/>
</p>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
|
|
Referencing An XSL File From An XML File: events5.xml
|
<?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="events5.xsl"?>
<events>
<play Ptype = "drama">
<title>Three Sisters </title>
<author>
<First_Name>Anton</First_Name>
<Last_Name>Chekhov</Last_Name>
</author>
</play>
<play Ptype = "comedy">
<title>As You Like It</title>
<author>
<First_Name>William</First_Name>
<Last_Name>Shakespeare</Last_Name>
</author>
</play>
</events>
|
|
How It Appears In An XML-Capable Browser (MS IE5)
|
|
Files
Resources
|
|
 |
|
 |