First page Back Continue Last page Graphics

A Basic Style Sheet


Notes:

As a starting point, let’s look at a basic style sheet for our student transcript. This style sheet will illustrate the use of templates, pattern matching and insertion of literal text.
Here is the style sheet:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="transcript">
<HTML><BODY>
<FONT SIZE="6"><B>Student Transcript</B></FONT><P/>
<xsl:apply-templates select="student" />
<HR/>
<TABLE ALIGN="left" BORDER="1" CELLPADDING="4">
<TR>
<TH>Course Name</TH>
<TH>Grade</TH>
<TH ALIGN="right">Credits</TH>
</TR>
<xsl:apply-templates select="term" />
</TABLE>
</BODY></HTML>
</xsl:template>
<!-- Continued... -->