[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Display more than one table in generic xslt - reg
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|