从复杂的xml-schema创建excel文件

时间:2014-11-07 16:02:56

标签: excel xsd

我正在考虑使用Excel文件将数据加载到EPA GHG模式(ghg_subpartp_inputs_v1.0.xsd)以定义XML Subpartp Inputs数据的可行性。

我没有精通或使用Excel和xml-schemas。

SubpartP架构具有嵌套的复杂元素,并且不会通过XML Maps工具接受到Excel。

错误消息:"无法加载指定的XML或架构源。"

我认为这是因为它是一个部分架构,意味着要包含在其他架构中?

这是架构本身:

                      架构名称:ghg_subpartp_inputs_v1.0.xsd         描述:输入验证工具 - 子部分P输入的XML模式                   

<xsd:complexType name="SubpartPInputsType">
    <xsd:sequence>
        <xsd:element name="SubpartPUnitInputs" minOccurs="0" maxOccurs="unbounded">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="UnitName" type="xsd:string"/>
                    <xsd:element name="Values">
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element name="EquationP1FeedstockInputs" type="EquationP1FeedstockInputsType" minOccurs="0" maxOccurs="unbounded" />
                                <xsd:element name="EquationP2FeedstockInputs" type="EquationP2FeedstockInputsType" minOccurs="0" maxOccurs="unbounded" />
                                <xsd:element name="EquationP3FeedstockInputs" type="EquationP3FeedstockInputsType" minOccurs="0" maxOccurs="unbounded" />
                            </xsd:sequence>
                        </xsd:complexType>
                    </xsd:element>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:unique name="UniqueSubpartPFeedstockName">
                <xsd:selector xpath="Values/*"/>
                <xsd:field xpath="FeedstockName"/>
            </xsd:unique>
        </xsd:element>
    </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="EquationP1FeedstockInputsType">
    <xsd:sequence>
        <xsd:element name="FeedstockName" type="xsd:string"/>
        <xsd:element name="Values">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="MassOrVolume" type="MassOrVolumeIndicatorType"/>
                    <xsd:element name="EquationP1MonthlyInputs" minOccurs="0" maxOccurs="12">
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element name="MonthName" type="MonthNameList"/>
                                <xsd:element name="Values">
                                    <xsd:complexType>
                                        <xsd:sequence>
                                            <xsd:element name="Mass" type="xsd:decimal" minOccurs="0">
                                                <xsd:annotation>
                                                    <xsd:documentation>Required units of measure for this equation input: kg of fuel or feedstock</xsd:documentation>
                                                </xsd:annotation>
                                            </xsd:element>
                                            <xsd:element name="Volume" type="xsd:decimal" minOccurs="0">
                                                <xsd:annotation>
                                                    <xsd:documentation>Required units of measure for this equation input: scf (at standard conditions of 68 degrees F and atmospheric pressure) of fuel or feedstock</xsd:documentation>
                                                </xsd:annotation>
                                            </xsd:element>
                                            <xsd:element name="CarbonContent" type="xsd:decimal" minOccurs="0">
                                                <xsd:annotation>
                                                    <xsd:documentation>Required units of measure for this equation input: kg C per kg of fuel or feedstock</xsd:documentation>
                                                </xsd:annotation>
                                            </xsd:element>
                                            <xsd:element name="MolecularWeight" type="xsd:decimal" minOccurs="0">
                                                <xsd:annotation>
                                                    <xsd:documentation>Required units of measure for this equation input: kg/kg-mole</xsd:documentation>
                                                </xsd:annotation>
                                            </xsd:element>
                                        </xsd:sequence>
                                    </xsd:complexType>
                                </xsd:element>
                            </xsd:sequence>
                        </xsd:complexType>
                    </xsd:element>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:unique name="UniqueEquationP1MonthName">
                <xsd:selector xpath="*"/>
                <xsd:field xpath="MonthName"/>
            </xsd:unique>
        </xsd:element>
    </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="EquationP2FeedstockInputsType">
    <xsd:sequence>
        <xsd:element name="FeedstockName" type="xsd:string"/>
        <xsd:element name="Values">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="MassOrVolume" type="MassOrVolumeIndicatorType"/>
                    <xsd:element name="EquationP2MonthlyInputs" minOccurs="0" maxOccurs="12">
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element name="MonthName" type="MonthNameList"/>
                                <xsd:element name="Values">
                                    <xsd:complexType>
                                        <xsd:sequence>
                                            <xsd:element name="Mass" type="xsd:decimal" minOccurs="0">
                                                <xsd:annotation>
                                                    <xsd:documentation>Required units of measure for this equation input: kg of fuel or feedstock</xsd:documentation>
                                                </xsd:annotation>
                                            </xsd:element>
                                            <xsd:element name="Volume" type="xsd:decimal" minOccurs="0">
                                                <xsd:annotation>
                                                    <xsd:documentation>Required units of measure for this equation input: gallons of fuel or feedstock</xsd:documentation>
                                                </xsd:annotation>
                                            </xsd:element>
                                            <xsd:element name="CarbonContent" type="xsd:decimal" minOccurs="0">
                                                <xsd:annotation>
                                                    <xsd:documentation>Required units of measure for this equation input: kg C per kg of fuel or feedstock if measured as mass, or kg C per gallon of fuel or feedstock if measured as volume</xsd:documentation>
                                                </xsd:annotation>
                                            </xsd:element>
                                        </xsd:sequence>
                                    </xsd:complexType>
                                </xsd:element>
                            </xsd:sequence>
                        </xsd:complexType>
                    </xsd:element>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:unique name="UniqueEquationP2MonthName">
                <xsd:selector xpath="*"/>
                <xsd:field xpath="MonthName"/>
            </xsd:unique>
        </xsd:element>
    </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="EquationP3FeedstockInputsType">
    <xsd:sequence>
        <xsd:element name="FeedstockName" type="xsd:string"/>
        <xsd:element name="Values">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="EquationP3MonthlyInputs" minOccurs="0" maxOccurs="12">
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element name="MonthName" type="MonthNameList"/>
                                <xsd:element name="Values">
                                    <xsd:complexType>
                                        <xsd:sequence>
                                            <xsd:element name="Mass" type="xsd:decimal" minOccurs="0">
                                                <xsd:annotation>
                                                    <xsd:documentation>Required units of measure for this equation input: kg of fuel and feedstock</xsd:documentation>
                                                </xsd:annotation>
                                            </xsd:element>
                                            <xsd:element name="CarbonContent" type="xsd:decimal" minOccurs="0">
                                                <xsd:annotation>
                                                    <xsd:documentation>Required units of measure for this equation input: kg C per kg of fuel and feedstock</xsd:documentation>
                                                </xsd:annotation>
                                            </xsd:element>
                                        </xsd:sequence>
                                    </xsd:complexType>
                                </xsd:element>
                            </xsd:sequence>
                        </xsd:complexType>
                    </xsd:element>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:unique name="UniqueEquationP3MonthName">
                <xsd:selector xpath="*"/>
                <xsd:field xpath="MonthName"/>
            </xsd:unique>
        </xsd:element>
    </xsd:sequence>
</xsd:complexType>

我应该怎么做才能创建将为此架构创建可接受的XML的Excel文件?

0 个答案:

没有答案