C# 从XML到Excel 2010文件的转换

C# 从XML到Excel 2010文件的转换,c#,xml,excel,xslt,ms-word,C#,Xml,Excel,Xslt,Ms Word,如何为从XML文件到Excel 2010文件或Word 2010的XSLT转换创建模板 这是我们在Execel 2003中转换的模板。但现在我2010年需要它? 谢谢你的帮助 <xsl:stylesheet xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl=

如何为从XML文件到Excel 2010文件或Word 2010的XSLT转换创建模板

这是我们在Execel 2003中转换的模板。但现在我2010年需要它? 谢谢你的帮助

    <xsl:stylesheet xmlns="urn:schemas-microsoft-com:office:spreadsheet"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xslex="urn:XsltExtension"
                xmlns:html="http://www.w3.org/TR/REC-html40"
                xmlns:o="urn:schemas-microsoft-com:office:office"
                xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
                xmlns:x="urn:schemas-microsoft-com:office:excel"
                version="2.0">
  <xsl:output method="xml" indent="yes" />
   <xsl:output method="xml" version="1.0"/>
   <xsl:template match="/NewDataSet">
      <xsl:variable name="elements"          select="xs:schema/xs:element/xs:complexType/xs:choice/xs:element/xs:complexType/xs:sequence/*" />

      <xsl:variable name="columnAppearances" select="ColumnAppearances/*" />

      <xsl:processing-instruction name="mso-application">
         <xsl:text>progid="Excel.Sheet"</xsl:text>
      </xsl:processing-instruction>
      <Workbook>
     <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office" />
     <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
        <ProtectStructure>False</ProtectStructure>
        <ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
    </xsl:styleshee>

progid=“Excel.Sheet”
假的
假的

Excel 2007+使用的开放式XML格式由ZIP包中的许多XML组成。整体格式与您提到的单个文件XML格式非常不同。如果您现在有一个可用的解决方案,我建议您保持原样,并使用interop将其转换为新的格式。如果希望避免互操作,那么应该使用OpenXMLSDK。如果不是不可能的话,使用XSLT将是非常痛苦的,而且这肯定是离题的,因为这是一项大量的工作。

您的可能副本是对的,我看到了,但我需要它用于Excel 2010,不幸的是,它不一样