XML to Excel Style Sheet Question (Newbie)

Discussion in 'XML' started by Kevin, Jul 31, 2003.

  1. Kevin

    Kevin Guest

    I'm a newbie at XML and have a situation that needs to EXPORT a
    summary list for import into EXCEL.

    I'm using the simple_style sheet supplied by Filemaker and it does the
    job EXCEPT... it exports the fields (and field names) horizontally
    when opened in EXCEL (columns A-W).

    I would like it to export vertically (rows 1-22) when opened in EXCEL.
    Can anyone shed some light on what needs to be done to this style
    sheet (if it can be done within this style sheet)? I've toyed around
    with it a bit (3 hours) and have yet to get the result I want.

    Any help greatly appreciated!

    Kevin

    Kevin Morrison

    HERE IS THE CODE FOR THE STYLE SHEET AS IS COMPLIMENTS OF FILEMAKER
    PRO, INC.

    ***********

    -->
    <!--
    Template: match="fmp:FMPXMLRESULT"

    The main driver for building the table. Calls the header template then
    iterates through
    the RESULTSET nodeset to build the table rows.
    -->
    <xsl:template match="fmp:FMPXMLRESULT">
    <html>
    <body>
    <table border="1" cellPadding="1" cellSpacing="1">
    <xsl:call-template name="header"/>
    <xsl:for-each select="fmp:RESULTSET/fmp:COL">
    <tr>
    <xsl:for-each select="fmp:ROW">
    <td>
    <xsl:value-of select="fmp:DATA"/>
    </td>
    </xsl:for-each>
    </tr>
    </xsl:for-each>
    </table>
    </body>
    </html>
    </xsl:template>
    <!--
    Template: header

    Creates the heading for the HTML table. The database name and number
    of records
    are displayed above the field names.
    -->
    <xsl:template name="header">
    <tr>
    <td align="middle">
    <xsl:attribute name="colspan"><xsl:call-template
    name="numfields"/></xsl:attribute>
    <xsl:text>Database: </xsl:text>
    <xsl:value-of select="fmp:DATABASE/@NAME"/>
    </td>
    </tr>
    <tr>
    <td align="middle">
    <xsl:attribute name="colspan"><xsl:call-template
    name="numfields"/></xsl:attribute>
    <xsl:text>Records: </xsl:text>
    <xsl:value-of select="fmp:DATABASE/@RECORDS"/>
    </td>
    </tr>
    <tr>
    <xsl:for-each select="fmp:METADATA/fmp:FIELD">
    <td align="middle">
    <xsl:value-of select="@NAME"/>
    </td>
    </xsl:for-each>
    </tr>
    </xsl:template>
    <!--
    Template: numfields

    Simple utility template that checks for the number of children in the
    METADATA
    element and returns the number of fields in the database - handy when
    building
    tables.
    -->
    <xsl:template name="numfields" match="fmp:METADATA">
    <xsl:value-of select="count(fmp:METADATA/child::*)"/>
    </xsl:template>
    </xsl:stylesheet>


    *****************
    Kevin, Jul 31, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    510
  2. Peder Ydalus
    Replies:
    0
    Views:
    316
    Peder Ydalus
    Nov 16, 2003
  3. zxo102
    Replies:
    3
    Views:
    3,248
    Stuart Corrie
    Aug 9, 2005
  4. sajithkahawatta

    read a excel sheet using aspose.excel

    sajithkahawatta, Apr 19, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    524
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Apr 19, 2007
  5. Utada P.W. SIU

    Cannot using style sheet inside ASP generated Excel

    Utada P.W. SIU, Oct 4, 2004, in forum: ASP General
    Replies:
    1
    Views:
    270
    Ray Costanzo [MVP]
    Oct 4, 2004
Loading...

Share This Page