[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Fwd:

Subject: Fwd:
From: "Eugene Bernard" <eugene.bernard@xxxxxxxxx>
Date: Fri, 15 Feb 2008 09:30:54 +0530
 Fwd:
Hi all

Using the below XML data (Partial listing) and XSL, I am getting the
HTML output as below.

How to make it to compact horizontally tabulated HTML output like this
(to limit the size of my mail i have removed html tags)

HTML Output :

Code Due          Press ID    Qty
---------------------------------------------
A001
----------------------------------------------
     Beyond Mar
                              Press A     100
                             Press B     219
     Feb Due
                            Press A      47
                            Press B     365
     Mar Due
                            Press A      84
                            Press B     256
     Over Due
                            Press B       2
--------------------------------

HTML Output (Desired):

CODE    BEYOND MAR      FEB DUE         MAR DUE       OVER DUE
              A    B     C       D       A   B   C   D        A  B  C
 D        A   B   C    D
A001  100  219                      47  365               84  256
                2

XML:

<?xml version="1.0" ?>
- <mpour>
- <item>
  <ccode>A004</ccode>
  <due>Beyond Mar</due>
  <line>Press A</line>
  <pour>409</pour>
  <weight>3476.50</weight>
  </item>
- <item>
  <ccode>A004</ccode>
  <due>Beyond Mar</due>
  <line>Press A</line>
  <pour>300</pour>
  <weight>2550.00</weight>
  </item>
- <item>
  <ccode>A004</ccode>
  <due>Beyond Mar</due>
  <line>Press A</line>
  <pour>500</pour>
  <weight>4250.00</weight>
  </item>
- <item>

XSL :

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="mpour">
        <table border="1" cellspacing="0"
cellpadding="4"><tr><td>Code</td><td>Due</td><td>Press
ID</td><td>Qty</td></tr>
           <xsl:for-each-group select="item" group-by="ccode">
                <xsl:sort select="current-grouping-key()"/>
                <tr>
                    <td><xsl:value-of select="ccode"/></td>
                    <td/>
                    <td/>
                                        <td/>
                </tr>
                <xsl:for-each-group select="current-group()" group-by="due">
                    <xsl:sort select="current-grouping-key()"/>
                    <tr>
                        <td/>
                        <td><xsl:value-of select="due"/></td>
                        <td/>
                        <td/>
                    </tr>
      <xsl:for-each-group select="current-group()" group-by="line">
                        <xsl:sort select="current-grouping-key()"/>
                        <tr>
                            <td/>
                            <td/>
                   <td><xsl:value-of select="line"/></td>
              <td align="right"><xsl:value-of
select="format-number(sum(current-group()/pour),'######.##')" /></td>
                                      </tr>
                    </xsl:for-each-group>
                </xsl:for-each-group>
            </xsl:for-each-group>
        </table>
    </xsl:template>
</xsl:stylesheet>



Regards
 Eugene

Current Thread
  • Fwd:
    • Eugene Bernard - 15 Feb 2008 04:01:26 -0000 <=

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.