Like me on Facebook Follow me on Twitter Register or    (Why?)
Demo Notes - XSL Report
The following example shows an XSL report of a single employee record. XSL stands for Extensible Stylesheet Language and is a stylesheet language for XML documents. XSLT stands for XSL Transformations and can be used to transform XML data into standard HTML to be rendered to the browser.

In this example I'm pulling out a single employee record and using an xsl file to transform it into a simple vertical table.

The xsl to accomplish this looks like this:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="SQLData">
<table cellpadding="2" cellspacing="0" border="1" width="500px">
<xsl:for-each select="Table">
<tr>
<td style="background-color: #d0d0d0">
First Name
</td><td style="background-color: #ffffff">
<xsl:value-of select="FirstName"/>
</td>
</tr>

<tr>
<td style="background-color: #d0d0d0">
Last Name
</td><td style="background-color: #ffffff">
<xsl:value-of select="LastName"/>

</td>
</tr>

<tr>
<td style="background-color: #d0d0d0">
Hire Date
</td><td style="background-color: #ffffff">
<xsl:value-of select="HireDate"/>
</td>
</tr>

<tr>
<td style="background-color: #d0d0d0">
Address
</td><td style="background-color: #ffffff">
<xsl:value-of select="Address"/>
</td>

</tr>

<tr>
<td style="background-color: #d0d0d0">
State
</td><td style="background-color: #ffffff">
<xsl:value-of select="State"/>
</td>
</tr>

<tr>
<td style="background-color: #d0d0d0">
Zip
</td><td style="background-color: #ffffff">
<xsl:value-of select="Zip"/>
</td>
</tr>

<tr>
<td style="background-color: #d0d0d0">
Country
</td><td style="background-color: #ffffff">
<xsl:value-of select="Country"/>
</td>
</tr>

</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>

The complete file is also located here Employee.xsl.

XSL Report
First Name Malcolm
Last Name Hubbard
Hire Date 03/03/2009
Address 67153 South Kenya Blvd.
State MT
Zip 29670
Country USA
Privacy StatementTerms Of UseCopyright (c) 2004-2015 DNNStuff
Page generated in 0.2030741 seconds!