开发者

Merge two xsd file in one xsd with c#

i want to merge two xsd 开发者_Python百科files to one xsd using c#. how can i do it with c#? can anyone help me?


You may be looking for <xsd:import /> or <xsd:include /> see the MSDN documentation for differences and restrictions.

Your main schema document

Main.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:import schemaLocation="Imported.xsd" />

    <xsd:element name="root">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="localElement" />
                <xsd:element ref="importedElement" />
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

</xsd:schema>

Your imported schema document

Imported.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:element name="importedElement">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="someElement" />
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

</xsd:schema>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜