Dear All,
I need help for an issue regarding XSLT.
I have a dataset with more than 1 data table. All data table will have
more than 1 rows.
So my XSLT requirement is to show all the datatables with all rows
displayed along with headers.
Every time the tables will different. So I want a generic xslt which
supports all tables.
I tried the XSLT below but all rows are displaying with headers
instead of a table having the headers.
Please help !
My XML data is
<?xml version="1.0" standalone="yes"?>
<Sales>
<DocHead>
<SysID>-2008080800041</SysID>
<WFDocID>0</WFDocID>
</DocHead>
<Line>
<SysID>-2008080800045</SysID>
<ParentSysID>-2008080800041</ParentSysID>
<DocType>51</DocType>
</Line>
<Line>
<SysID>-2008080800046</SysID>
<ParentSysID>-2008080800041</ParentSysID>
<DocType>51</DocType>
</Line>
</Sales>
Attempted XSL code is below.
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<HTML>
<BODY>
<xsl:for-each select="*/*">
<xsl:variable name="PrevRow" select="name(.)"/>
<Table border="1">
<tr>
<xsl:for-each select="*">
<td>
<xsl:value-of select="local-name()"/>
</td>
</xsl:for-each>
</tr>
<xsl:apply-templates/>
</Table>
</xsl:for-each>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="/*/*">
<xsl:param name="nodeset"/>
<TR>
<xsl:apply-templates />
</TR>
</xsl:template>
<xsl:template match="/*/*/*">
<TD>
<xsl:value-of select="."/>
</TD>
</xsl:template>
</xsl:stylesheet>
Regards,
Ramesh
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--