Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Convert XML to Excel using XSL

From: "Wilson Wu" <wilsonwu@---------.--->
To: NULL
Date: 7/6/2004 10:27:00 AM
Hi Rani,

Sorry to tell you that it create one worksheet only.  Any help ?

Thanks
Wilson


"Rani" <anonymous@d...> wrote in message
news:u5ze6BEYEHA.2868@T......
>
>
>
>
>
>
>
> My data.xml file
>
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="TestData.xslt"?>
> <dealsetup>
> <dealnbr>1</dealnbr>
> <name>USING FOR DEAL COPY</name>
> </dealsetup>
>
> And my TestData.xslt file....
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0"
>     xmlns:x="urn:schemas-microsoft-com:office:excel"
>     xmlns:o="urn:schemas-microsoft-com:office:office"
> xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
>     xmlns="http://www.w3.org/TR/REC-html40">
>
> <xsl:output method="html" omit-xml-declaration="yes" />
> <xsl:template match="/">
>
> <HTML>
> <HEAD>
> <xsl:text disable-output-escaping="yes">&lt;</xsl:text>meta
> name="ProgId content=Excel.Sheet" /<xsl:text
> disable-output-escaping="yes">&gt;</xsl:text>
> <xsl:text disable-output-escaping="yes">&lt;</xsl:text>meta
> name="Generator" content="Microsoft Excel 10" /<xsl:text
> disable-output-escaping="yes">&gt;</xsl:text>
>     <xsl:text disable-output-escaping="yes">&lt;</xsl:text>link
> rel=File-List href="out_files/filelist.xml"<xsl:text
> disable-output-escaping="yes">&gt;</xsl:text>
> <xsl:text
> disable-output-escaping="yes">&lt;</xsl:text><![CDATA[!--[if gte mso
> 9]]]><xsl:text disable-output-escaping="yes">&gt;</xsl:text>
> <xml>
> <x:ExcelWorkbook>
> <x:ExcelWorksheets>
>
> <xsl:call-template name="CreateWorkSheet">
> <xsl:with-param name="WorkSheetName">First Sheet</xsl:with-param>
> </xsl:call-template>
>
> <xsl:call-template name="CreateWorkSheet">
> <xsl:with-param name="WorkSheetName">Second Sheet</xsl:with-param>
> </xsl:call-template>
>
> <xsl:call-template name="CreateWorkSheet">
> <xsl:with-param name="WorkSheetName">Third Sheet</xsl:with-param>
> </xsl:call-template>
>
> </x:ExcelWorksheets>
>
> <x:ActiveSheet>0</x:ActiveSheet>
>
> </x:ExcelWorkbook>
>
> </xml>
> <xsl:text
> disable-output-escaping="yes">&lt;</xsl:text><![CDATA[![endif]--]]><xsl:
> text disable-output-escaping="yes">&gt;</xsl:text>
> </HEAD>
> <BODY>
> <H2>Summary</H2>
> <xsl:for-each select="dealsetup">
>
> <BR>DealNbr: <xsl:value-of select="dealnbr"/></BR>
> <BR>Name: <xsl:value-of select="name"/></BR>
>
> </xsl:for-each>
> </BODY>
> </HTML>
> </xsl:template>
>
> <xsl:template name="CreateWorkSheet">
> <xsl:param name="WorkSheetName"/>
> <x:ExcelWorksheet>
> <x:Name><xsl:value-of select="$WorkSheetName"/></x:Name>
> <x:WorksheetOptions>
> <x:Selected/>
> <x:ProtectContents>False</x:ProtectContents>
> <x:ProtectObjects>False</x:ProtectObjects>
> <x:ProtectScenarios>False</x:ProtectScenarios>
> </x:WorksheetOptions>
> </x:ExcelWorksheet>
> </xsl:template>
>
> </xsl:stylesheet>
>
> Try opening data.xml file in excel. This creates multiple work sheets.
>
> Rani
>
>
>
> *** Sent via Devdex http://www.devdex.com ***
> Don't just participate in USENET...get rewarded for it!




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent