[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

Subject: Display more than one table in generic xslt - reg
From: Ramesh Kumar <cnrameshkumar@xxxxxxxxx>
Date: Tue, 23 Mar 2010 20:03:24 +0400
 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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.