EXCEL的XML描述
来源:互联网 发布:grub手动引导windows 编辑:程序博客网 时间:2024/05/16 04:50
1,文件信息:
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
2,正文部分应包含在<Workbook></Workbook>之间:
<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">
.....
</Workbook>
3, 文档属性选项应包含在Workbook标识中,并处于Worksheet范围之外:
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<Author>Castor</Author>
<Created>2010-03-13T18:25:49Z</Created>
<Company>Not defined</Company>
<Version>1.0</Version>
</DocumentProperties>
4,ExcelWorkbook 记录了一些环境变量:
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<WindowHeight>10005</WindowHeight>
<WindowWidth>10005</WindowWidth>
<WindowTopX>120</WindowTopX>
<WindowTopY>135</WindowTopY>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
5,在Worksheet之外可以定义多个Style,所有Style应位于<Styles></Styles>之间,这些Style在书写各单元格的时候会用到:
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Top"/>
<Borders/>
<Font ss:FontName="Arial" x:Family="Swiss"/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID="s62" ss:Name="Hyperlink">
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
</Borders>
<Font ss:FontName="Arial" x:Family="Swiss" ss:Color="#0000FF"
ss:Underline="Single"/>
</Style>
<Style ss:ID="s63">
<Alignment ss:Horizontal="Left" ss:Vertical="Bottom" ss:WrapText="1"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
</Borders>
<Font ss:FontName="Arial" x:Family="Swiss" ss:Bold="1"/>
</Style>
</Styles>
6,Worksheet标识之间定义了一个工作表,一个文件可以定义多个Worksheet:
<Worksheet ss:Name="My First Sheet">
</Worksheet>
7,Worksheet之内有个Tables,定义了表的内容:
<Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="2" x:FullColumns="1" x:FullRows="1">
……
</Table>
8,<Column>定义了各列的宽度:
<Column ss:Width="50.25"/>
<Column ss:Width="99.75"/>
9,接下来,每一个<Row></Row>之间定义的就是表格一行的内容,每个<Cell></Cell>则对应一个单元格,注意每行的列数和总的行数应该和<Table>中定义的一致:
<Row ss:AutoFitHeight="0" ss:Height="63.75">
<Cell ss:StyleID="s63"><Data ss:Type="String">A1</Data></Cell>
<Cell ss:StyleID="s63"><Data ss:Type="String">B1</Data></Cell>
</Row>
10,Table定义完之后,还可以用<>定义一些设置:
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<Print>
<ValidPrinterInfo/>
<PaperSizeIndex>9</PaperSizeIndex>
<HorizontalResolution>600</HorizontalResolution>
<VerticalResolution>600</VerticalResolution>
</Print>
<DoNotDisplayGridlines/>
<Panes>
<Pane>
<Number>3</Number>
<ActiveRow>1</ActiveRow>
</Pane>
</Panes>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
****************************************
下面是一个完整的示例,可以COPY到记事本中,然后存成XML文件,即可用EXCEL打开:
<?xml version="1.0"?><!--Wrote by Castor-->
<?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">
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<Author>Castor</Author><!--Qm Xu-->
<Created>2010-03-13T18:25:49Z</Created>
<Company>Unknown</Company>
<Version>1.0</Version>
</DocumentProperties>
<OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
<AllowPNG/>
</OfficeDocumentSettings>
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<WindowHeight>10005</WindowHeight>
<WindowWidth>10005</WindowWidth>
<WindowTopX>120</WindowTopX>
<WindowTopY>135</WindowTopY>
<ActiveSheet>1</ActiveSheet>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Top"/>
<Borders/>
<Font ss:FontName="Arial" x:Family="Swiss"/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID="s66" ss:Name="Hyperlink">
<Font ss:FontName="Arial" x:Family="Swiss" ss:Color="#0000FF"
ss:Underline="Single"/>
</Style>
<Style ss:ID="s63">
<Alignment ss:Horizontal="Left" ss:Vertical="Bottom" ss:WrapText="1"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
</Borders>
<Font ss:FontName="Arial" x:Family="Swiss" ss:Bold="1"/>
</Style>
<Style ss:ID="s67">
<Alignment ss:Horizontal="Left" ss:Vertical="Top" ss:WrapText="1"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
</Borders>
</Style>
<Style ss:ID="s68" ss:Parent="s66">
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
</Borders>
<Interior/>
</Style>
</Styles>
<Worksheet ss:Name="My First Sheet">
<Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="2" x:FullColumns="1" x:FullRows="1">
<Column ss:Width="50.25"/>
<Column ss:Width="99.75"/>
<Row ss:AutoFitHeight="0" ss:Height="63.75">
<Cell ss:StyleID="s63"><Data ss:Type="String">A1</Data></Cell>
<Cell ss:StyleID="s63"><Data ss:Type="String">B1</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="25.5">
<Cell ss:StyleID="s68" ss:HRef="http://hi.baidu.com/xuqm"><Data
ss:Type="String">A2</Data></Cell>
<Cell ss:StyleID="s67"><Data ss:Type="String">B2</Data></Cell>
</Row>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<Print>
<ValidPrinterInfo/>
<PaperSizeIndex>9</PaperSizeIndex>
<HorizontalResolution>600</HorizontalResolution>
<VerticalResolution>600</VerticalResolution>
</Print>
<DoNotDisplayGridlines/>
<Panes>
<Pane>
<Number>3</Number>
<ActiveRow>1</ActiveRow>
</Pane>
</Panes>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
<Worksheet ss:Name="My Second Sheet">
<Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" x:FullColumns="1"
x:FullRows="1">
<Row>
<Cell><Data ss:Type="String">A1,2</Data></Cell>
</Row>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<Selected/>
<Panes>
<Pane>
<Number>3</Number>
<ActiveRow>1</ActiveRow>
</Pane>
</Panes>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
</Workbook>
<!--到此结束(Castor)-->
- EXCEL的XML描述
- asp.net中利用XML描述文件和Excel模板相结合的方法生成Excel报表
- 统计描述的EXCEL操作
- XML-Schema的DTD描述
- XML-RPC的基本描述
- excel的XML映射
- Hadoop的hdfs-site.xml配置描述
- xml文件解析,同步xml文件描述的文件
- Excel 2003的XML文件格式
- excel的xml表示形式
- Excel的xml表现格式
- 生成xml格式的excel
- xml,Excel文件的读取
- xml,Excel文件的读取
- Excel的xml表现格式
- OLEDB 读取Excel的问题描述及解决办法
- 利用xml 的数据描述功能设计灵活的专题模板
- 关于基于XML描述的GUI应用的一些资源
- CentOS下安装QT5
- Ibatis 后台打印完整的sql语句
- zencart 新产品&推荐产品页面产品图片横排方法
- 在html里面用javascript实现ajax请求访问servlet
- Class.forName
- EXCEL的XML描述
- 使用Map 按键值排序
- 深入浅出之正则表达式(一)
- Linux环境变量的设置和查看方法
- requestWindowFeature使用详解
- CSDN论坛目录树调整公告
- GoldenGate Data Pump 进程 report 报 WARNING OGG-01223 Cannot find executable file './server' 无法启动
- 修改rpm制作包的默认路径
- Ubuntu12.04添加自定义图标