XML to Excel Style Sheet Question (Newbie)

K

Kevin

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>


*****************
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top