Using XSD2CODE with Multiple Schema Files

I use XSD2CODEwith Visual Studio 2010. I know that I can right-click on the schema file ( XSD) and generate a C # class from it.

I would like to know how I can generate a C # class when I have two schema files for one XML file?

Additional Information:

Perhaps I did not provide enough details in my original question.

Link to the question Why does XSD.EXE create two .XSD files and how to use them? I basically ask the same question for XSD2CODEinstead XSD.

With XSD, I would use the command:

D:\>xsd response.xsd response_app1.xsd /classes

How to do this using XSD2CODEboth the VS 2010 GUI and the command line?

+5
source share
1 answer

EDIT:
To answer the updated question, then it doesn't seem like Xsd2Code was designed to process multiple .xsd files at a time.

I compile this from:

Pascal Cabanel seems to be pretty active on the Xsd2Code CodePlex website. Consider contacting him for a specific answer: http://www.codeplex.com/site/users/view/pcabanel

  • I will leave my preview. answer below

xsd2Code, .xsd "", / Xsd2CodeCustomTool " ".

"" .xsd , include.

Person.xsd, Employees.xsd include -ing Person.xsd Person.

  • , Employees.xsd Person.xsd, Xsd2Code Employees.xsd.

Person.xsd

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="CommonNamespace"
           xmlns="CommonNamespace"
    >   
    <xs:complexType name="Person">
        <xs:sequence>
            <xs:element name="Name" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
</xs:schema>

Employees.xsd

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="CommonNamespace"
           xmlns="CommonNamespace"
    >
    <xs:include schemaLocation="Person.xsd"/>

    <xs:element name="Employees">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Employee" type="Person" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

</xs:schema>
+3

All Articles