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>
精彩评论