|
I have one DataSet.xsd with two tables and two .xml files, each table has it's own seperate xml.
DataSet1.xsd ------- datatable1 ---- datatable1.xml
^------- datatable2 ---- datatable2.xml
I need two tables on the same HTML page. I'm having difficulty coding the .xslt file. Here is what I have so far.....
I don't know how to tie each table to each template.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:tbl="http://tempuri.org/DataSet1.xsd" exclude-result-prefixes="tbl">
<xsl:template match="/">
<html>
<head>
<title>Customers</title>
</head>
<body>
<h1 style=" font-family:arial; font-size:12pt; font-weight:bold; text-align:left;">Customers:</h1>
<table border="1" style="width:100%">
<thead>
<tr style =" font-family:arial; font-size:10pt; font-weight:bold; text-align:center; background-color:FAF8CC; cell-padding:10px">
<td>Date/Time</td>
<td>First Name</td>
<td>Last Name</td>
<td>Gender</td>
<td>Age</td>
</tr>
</thead>
<xsl:apply-templates/>
</table>
<h1 style=" font-family:arial; font-size:12pt; font-weight:bold; text-align:left;">Jobs:</h1>
<table border="1" style="width:100%">
<thead>
<tr style =" font-family:arial; font-size:10pt; font-weight:bold; text-align:center; background-color:FAF8CC; cell-padding:10px">
<td>Date/Time</td>
<td>Current</td>
<td>Past</td>
</tr>
</thead>
<xsl:apply-templates/>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="tbl:tablecustomers">
<tr style =" font-family:arial; font-size:10pt; font-weight:normal; text-align:left; background-color:FFFFFF; cell-padding:10px">
<td>
<xsl:value-of select="tbl:datetime"/>
</td>
<td>
<xsl:value-of select="tbl:firstname"/>
</td>
<td>
<xsl:value-of select="tbl:lastname"/>
</td>
<td>
<xsl:value-of select="tbl:gender"/>
</td>
<td>
<xsl:value-of-select="tbl:age"/>
<td>
</tr>
</xsl:template>
<xsl:template match="tbl:primarykey"/>
<xsl:template match="tbl:tableinfo">
<tr style =" font-family:arial; font-size:10pt; font-weight:normal; text-align:left; background-color:FFFFFF; cell-padding:10px">
<td>
<xsl:value-of select="tbl:datetime"/>
</td>
<td>
<xsl:value-of select="tbl:current"/>
</td>
<td>
<xsl:value-of select="tbl:past"/>
</td>
</tr>
</xsl:template>
<xsl:template match="tbl:primarykey"/>
</<xsl:stylesheet>
|