XSL for Excel

Joined
May 8, 2008
Messages
1
Reaction score
0
I have created this stylesheet for XML source. But when i open the excel sheet it displays the rows as colummns. what am i doing wrong. please help.

<?xml version="1.0" ?>
<ROWSET>
<ROW>
<EMAIL_ADDRESS>[email protected]</EMAIL_ADDRESS>
<FULL_NAME>Brookes, Allan</FULL_NAME>
<AMOUNT_LIMIT>200000</AMOUNT_LIMIT>
</ROW>
<ROW>
<EMAIL_ADDRESS>[email protected]</EMAIL_ADDRESS>
<FULL_NAME>Brookes, Allan</FULL_NAME>
<AMOUNT_LIMIT>50000</AMOUNT_LIMIT>
</ROW>
<ROW>
<EMAIL_ADDRESS>[email protected]</EMAIL_ADDRESS>
<FULL_NAME>Born, Martha</FULL_NAME>
<AMOUNT_LIMIT>25000</AMOUNT_LIMIT>
</ROW>
</ROWSET>

in the excel sheet it displays like this

ns1:Name Data ns1:Type
HR_Hierarchy_feed_to_CT_ (e-mail address removed) String
Hierarchy_feed_to_CT_ Brookes, Allan String
HR_Hierarchy_feed_to_CT_ 200000 Number
HR_Hierarchy_feed_to_CT_ (e-mail address removed) String
HR_Hierarchy_feed_to_CT_ Brookes, Allan String
HR_Hierarchy_feed_to_CT_ 50000 Number
HR_Hierarchy_feed_to_CT_ (e-mail address removed) String
HR_Hierarchy_feed_to_CT_ Born, Martha String
HR_Hierarchy_feed_to_CT_ 25000 Number

I want it like this
(e-mail address removed) Brookes, Allan 200000
(e-mail address removed) Brookes, Allan 50000
(e-mail address removed) Born, Martha 25000


XSL Stylesheet

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ss="urn:schemas-microsoft-com:eek:ffice:spreadsheet"
xmlns:eek:="urn:schemas-microsoft-com:eek:ffice:eek:ffice"
xmlns:x="urn:schemas-microsoft-com:eek:ffice:excel">
<xsl:template match="/">
<Workbook>
<Worksheet ss:Name="HR_Hierarchy_feed_to_CT_">
<Table>
<xsl:for-each select="ROWSET/ROW">
<ROW>

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

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

<Cell>
<Data ss:Type="Number">
<xsl:value-of select="AMOUNT_LIMIT"/>
</Data>
</Cell>

</ROW>
</xsl:for-each>
</Table>
</Worksheet>
</Workbook>
</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

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top