Mr. Clean wrote:
Quote:
Very new to XML style sheets and need some help getting this XML:
[bunch of XML source removed]
to look like this HTML:
[lots of HTML code removed]
Anyone want to give me a hand??? |
Where's the results of work you've done this far? Surely you don't
expect us to do your work, do you? Hopefully this isn't some homework
you're too lazy to do yourself....
Here's something I won't bother testing. Perhaps it helps you, perhaps
it doesn't. By the way, XSTL is really for XML->XML transforms so you
cannot easily generate HTML, only XHTML [fragments]. And the
pseudo-(X)HTML code you provided was broken but I didn't bother fixing
it either.
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Copyright (c) 2003 Mikko Rantalainen, this
code can be distributed under GPL.
TODO: fix the colgroup element(s).
-->
<xsl:template match="/">
<table>
<colgroup>
<colgroup span="3">
<thead>
<tr>
<th scope="colgroup" colspan="3">CDS Logger Error Messeges</th>
</tr>
<tr>
<th scope="col">Batch Name</th>
<th scope="col">Error Code</th>
<th scope="col">Success</th>
</tr>
</thead>
<tbody>
<xsl:apply-templates select="//ErrorObject">
</xsl:apply-templates>
</tbody>
</table>
</xsl:template><!-- match / -->
<xsl:template match="ErrorObject">
<tr>
<td><xsl:value-of select="BatchName" /></td>
<td><xsl:value-of select="ErrorCode" /></td>
<td><xsl:value-of select="Success" /></td>
</tr>
</xsl:template><!-- match ErrorObject -->
<xsl:template match="*">
<div>UNKNOWN: <xsl:value-of select="." /></div>
</xsl:template>
</xsl:stylesheet>
--
Mikko