Subject: Using XSLT to create an XHTML document From: Christiane Faucher <christiane@xxxxxxxxxxx> Date: Thu, 3 Jun 1999 16:00:08 -0400 |
I am new in the XSLT world... I have read that an XSL style sheet can be used to generate XHTML. My question is the following: Do we need a specialized XSL formatting engine to render the result generated by the XSLT (to output it on the screen)? I know that it should produce an XHTML file viewable on a browser but... How come I do not see that newly generated XHTML file when I apply the stylesheet to the data document? What steps am I missing? (Obviously I am missing some!)
Any idea/suggestion/correction are more than welcome...
Thanks
Christiane
This is an example of using XSLT to create an XHTML document. The following stylesheet (XHTMLTranformation.xsl):
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
xmlns="http://www.w3.org/Profiles/xhtml1-transitional"
default-space="strip"
indent-result="yes">
<xsl:template match="/">
<html>
<head>
<title>Sales Results By Division</title>
</head>
<body>
<table border="1">
<tr>
<th>Division</th>
<th>Revenue</th>
<th>Growth</th>
<th>Bonus</th>
</tr>
<xsl:apply-templates/>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="sales">
<xsl:apply-templates match="division">
<!-- order the result by revenue -->
<xsl:sort select="revenue"
data-type="number"
order="descending"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="division">
<tr>
<td><em><xsl:value-of select="@id"/></em></td>
<xsl:apply-templates select="revenue"/>
<xsl:apply-templates select="growth"/>
<xsl:apply-templates select="bonus"/>
</tr>
</xsl:template>
<xsl:template match="revenue | growth | bonus">
<td><xsl:apply-templates/></td>
</xsl:template>
</xsl:stylesheet>
---- with the following input document:
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="">
<sales>
<division id="North">
<revenue>10</revenue>
<growth>9</growth>
<bonus>7</bonus>
</division>
<division id="South">
<revenue>4</revenue>
<growth>3</growth>
<bonus>4</bonus>
</division>
<division id="West">
<revenue>6</revenue>
<growth>-1.5</growth>
<bonus>2</bonus>
</division>
</sales>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Another variable question, Kay Michael | Thread | Re: Using XSLT to create an XHTML d, Francis Norton |
Re: MSXSL Processor, Duane Nickull | Date | RE: server side tools..., Shalperin |
Month |