用于Excel XML导出的XML模式 [英] XML schema for Excel XML exportation
问题描述
我正在尝试创建一个XML模式来将Excel文件转换为XML文件。
样本.xls文件有两个单元格,其中
I'm getting mad trying to create an XML schema to transform an Excel file to an XML file. The sample .xls file has two cell with
- 事件的名称和
- 位置的名称
然后有一个表,每一列有一个会话和一个骑手的名字。
要保存为XML数据,我需要使用XML模式,并使用 Excel 2003加载项:XML工具加载项。
所以我有这个XML模式:
To save as XML data I need to make the XML schema and I've achived this using the Excel 2003 Add-in: XML Tools Add-in. So I have this XML schema:
<?xml version='1.0' encoding='UTF-16'?>
<!-- Created from XmlMap.Name: Results_mapping -->
<!-- XmlMap.DataBinding.SourceUrl: -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element nillable="true" name="Results">
<xsd:complexType>
<xsd:sequence minOccurs="0">
<xsd:element minOccurs="0" maxOccurs="unbounded" nillable="true" name="rider" form="unqualified">
<xsd:complexType>
<xsd:sequence minOccurs="0">
<xsd:element minOccurs="0" nillable="true" type="xsd:string" name="Column1" form="unqualified"/>
<xsd:element minOccurs="0" nillable="true" type="xsd:integer" name="Column_1st_session" form="unqualified"/>
<xsd:element minOccurs="0" nillable="true" type="xsd:integer" name="Column_2nd_session" form="unqualified"/>
<xsd:element minOccurs="0" nillable="true" type="xsd:integer" name="Column_3rd_session" form="unqualified"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
其中生成以下XML代码:
which generate the following XML code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Results xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<rider>
<Column1>Mike</Column1>
<Column_1st_session>5</Column_1st_session>
<Column_2nd_session>10</Column_2nd_session>
<Column_3rd_session>8</Column_3rd_session>
</rider>
<rider>
<Column1>John</Column1>
<Column_1st_session>5</Column_1st_session>
<Column_2nd_session>9</Column_2nd_session>
<Column_3rd_session>8</Column_3rd_session>
</rider>
<rider>
<Column1>Lea</Column1>
<Column_1st_session>4</Column_1st_session>
<Column_2nd_session>9</Column_2nd_session>
<Column_3rd_session>8</Column_3rd_session>
</rider>
</Results>
这并不完全坏,但我想要有一些像
That's not completely bad but I'd like to have something like
<rider name="Mike">
<session name="1st_session">5</session>
<session name="2nd_session">10</session>
<session name="3rd_session">8</session>
</rider>
有人可以帮我吗?
谢谢!
can anybody please help me? Thanks!
推荐答案
经过多篇教程和手册,我发现了一个非常有用的指南,的* xls文件自动和没有插件...非常好! http://www.mrexcel.com/articles/using-xml-in -excel.php
After many tutorials and manuals I've found a really useful guide about how to make the mapping of the *xls file automatically and without plug-in...very good! http://www.mrexcel.com/articles/using-xml-in-excel.php
这篇关于用于Excel XML导出的XML模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!