templates | style Sheets
The template file is as follows:
<?xml version= "1.0" encoding= "UTF-8"?>
<root xmlns:sql= "Urn:schemas-microsoft-com:xml-sql" sql:xsl= "myxsl.xsl" >
<sql:query>
Select firstname,lastname from Employees for XML Auto
</sql:query>
</root>
Here, the template file tempxsl.xml is stored in the directory associated with the template type's virtual name (template). The XSL file (myxsl.xsl) is also stored in the same directory. myxsl.xsl files are as follows:
<?xml version= "1.0" encoding= "UTF-8"?>
<xsl:stylesheet version= "1.0" xmlns:xsl= "http://www.w3.org/1999/XSL/Transform" >
<xsl:template match= "*" >
<xsl:apply-templates/>
</xsl:template>
<xsl:template match= "Employees" >
<tr>
<td><xsl:value-of select= "@FirstName"/></td>
<td><xsl:value-of select= "@LastName"/></td>
</tr>
</xsl:template>
<xsl:template match= "/" >
<style>th{background-color: #cccccc}</style>
<body>
<table border= "2" style= "width:300;" >
<tr><th colspan= "2" >Employees</th></tr>
<tr><th>first Name</th><th>last name</th></tr>
<xsl:apply-templates select= "root"/>
</table>
</body>
</xsl:template>
</xsl:stylesheet>
Execute Template:http://localhost/template/tempxsl.xml