Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

Re: Multiple internal tables are not getting generated properly in .xsl file

$
0
0

Hi Aditi,

 

you need to loop over the items in your xml to generate rows in the excel file.

try with this modified xsl

 

<?xml version="1.0" encoding="UTF-8"?>

<?mso-application progid="Excel.Sheet"?>

<xsl:stylesheet version="1.0"

xmlns:html="http://www.w3.org/TR/REC-html40"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns="urn:schemas-microsoft-com:office:spreadsheet"

xmlns:o="urn:schemas-microsoft-com:office:office"

xmlns:x="urn:schemas-microsoft-com:office:excel"

xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">

 

<xsl:template match="/">

 

<Workbook>

<Styles>

<Style ss:ID="Default" ss:Name="Normal">

<Alignment ss:Vertical="Bottom" />

<Borders />

<Font />

<Interior />

<NumberFormat />

<Protection />

</Style>

<Style ss:ID="s21">

<Font ss:Size="22" ss:Bold="1" />

</Style>

<Style ss:ID="s22">

<Font ss:Size="14" ss:Bold="1" />

</Style>

<Style ss:ID="s23">

<Font ss:Size="12" ss:Bold="1" />

</Style>

<Style ss:ID="s24">

<Font ss:Size="10" ss:Bold="1" />

</Style>

</Styles>

 

<Worksheet ss:Name="EXPORTDATA">

<Table>

<xsl:call-template name="XMLToXSL" />

</Table>

</Worksheet>

</Workbook>

 

</xsl:template>

 

<xsl:template name="XMLToXSL">

<Row>

<Cell>

<Data ss:Type="String">number1</Data>

</Cell>

<Cell>

<Data ss:Type="String">number2</Data>

</Cell>

<Cell>

<Data ss:Type="String">DATE</Data>

</Cell>

<Cell>

<Data ss:Type="String">EMPLOYEENAME</Data>

</Cell>

</Row>

 

<xsl:for-each select="//item">

<Row>

<xsl:for-each select="EXPORT1">

<Cell>

<Data ss:Type="String"><xsl:value-of select="number1" /></Data>

</Cell>

<Cell>

<Data ss:Type="String"><xsl:value-of select="number2" /></Data>

</Cell>

</xsl:for-each>

 

<xsl:for-each select="EXPORT2">

<Cell>

<Data ss:Type="String"><xsl:value-of select="DATE" /></Data>

</Cell>

</xsl:for-each>

 

<xsl:for-each select="EXPORT3">

<Cell>

<Data ss:Type="String"><xsl:value-of select="EMPLOYEENAME" /></Data>

</Cell>

</xsl:for-each>

</Row>

</xsl:for-each>

</xsl:template>

<xsl:template match="ZCF_numbers">

</xsl:template>

</xsl:stylesheet>


Viewing all articles
Browse latest Browse all 9129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>