EDIT:
To answer the updated question, then it doesn't seem that Xsd2Code was designed to handle more than one .xsd file at a time.
I gather this from:
- The command-line syntax
Xsd2Code.exe <XSD File> [Namespace] [Output file name] [Options]
- A quick browse at the source code (download build 88331 from http://xsd2code.codeplex.com/SourceControl/list/changesets and look into
Trunk\Xsd2Code.Console\EntryPoint.cs
.
Pascal Cabanel seems to be pretty active on Xsd2Code's CodePlex site. Consider contacting him for a definite answer:
http://www.codeplex.com/site/users/view/pcabanel
- I'll leave my prev. answer below
In order to automatically create the supporting xsd2Code class files, you can click the .xsd file in the Solution Explorer and in the Properties window, write/paste Xsd2CodeCustomTool into the "Custom Tool" property.
In order to "see" data types from one .xsd file in the other, you can use an include
statement.
Here's an example with a Person.xsd containing a data definition and Employees.xsd include
-ing Person.xsd and consuming the Person
data type.
- Note that since Employees.xsd already includes Person.xsd, you will only have to generate Xsd2Code for 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>