使用多个工作表将xml转换为excel [英] convert xml to excel with multiple worksheet

查看:233
本文介绍了使用多个工作表将xml转换为excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我将以下xml导出到excel 2007 ...我可以正确地获取excel表。

if I export the below xml to excel 2007...i am able to get the excel sheet correctly.

<Workbook>
<Worksheet >
<MyXml>
    <New A="111" B="222" />
</MyXml>
<MyXml>
    <New A="111" B="222" />
</MyXml>
</Worksheet>
</Workbook>

但是我需要一个包含多个工作表的工作簿...如何在此指定xml案例?

But I need a workbook with more than one worksheet...How do i specify the xml in this case ?

推荐答案

尝试这样:

<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook 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"
 xmlns:html="http://www.w3.org/TR/REC-html40">
 <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
  <ActiveSheet>2</ActiveSheet>
 </ExcelWorkbook>
 <Styles>
  <Style ss:ID="Default" ss:Name="Normal">
   <Alignment ss:Vertical="Bottom"/>
   <Borders/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>
   <Interior/>
   <NumberFormat/>
   <Protection/>
  </Style>
 </Styles>
 <Worksheet ss:Name="Sheet1">
  <Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="1" x:FullColumns="1"
   x:FullRows="1" ss:DefaultRowHeight="15">
   <Row>
    <Cell><Data ss:Type="Number">11</Data></Cell>
    <Cell><Data ss:Type="Number">22</Data></Cell>
   </Row>
  </Table>
 </Worksheet>
 <Worksheet ss:Name="Sheet2">
  <Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="1" x:FullColumns="1"
   x:FullRows="1" ss:DefaultRowHeight="15">
   <Row>
    <Cell><Data ss:Type="Number">11</Data></Cell>
    <Cell><Data ss:Type="Number">22</Data></Cell>
   </Row>
  </Table>
 </Worksheet>
</Workbook>

有关更多帮助,您可以查看这个

For more help you can take a look at this.

最后,您可以手动创建一个excel工作簿并将其导出为XML,以便您可以检查XML的格式。

Finally, you can manually create an excel workbook and export it to XML so that you can examine the XML's format.

这篇关于使用多个工作表将xml转换为excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆