The schemaLocation attribute is intended to specify the location of the imported .xsd file. However, Xsd.exe ignores the schemaLocation attribute when it appears in the the <import> element. Instead, for Xsd.exe any imported files are specified as additional command-line arguments.
The generated source file gets the name of the last XSD file passed as an argument. Take as an example the following command-line invocation of Xsd.exe:
xsd importedAttribute.xsd attributeRef.xsd /classes /language:CS
The resulting source file is given the name attributeRef.cs.
Note: |
|---|
Xsd.exe does use the schemaLocation attribute when it appears in the <include> element. When generating source code from an XML Schema document, Xsd.exe recognizes an absolute file-system path for the value. See Include Element Binding Support. |