I have an XSD file that includes another XSD file in a C# program. Here is the first XSD file
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.test.org/namespaces/Test"
xmlns:ts="http://www.test.org/namespaces/Test"
elementFormDefault="qualified">
<!-- IRP Account Input Transaction, T0020, version 1 -->
<include schemaLocation="globalTypes.xsd"/>
....
Here is the globalTypes.xsd file
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
version="1.0" elementFormDefault="qualified" xml:lang="EN">
<simpleType name="globalAddressTypeValues">
<restriction base="string">
<enumeration value="MA"/>
<enumeration value="PH"/>
</restriction>
</simpleType>
<simpleType name="globalNameTypeValues">
<restriction base="string">
<enumeration value="LG"/>
<enumeration value="DB"/>
</restriction>
</simpleType>
...(etc.)
Here is my error when I try to load the schema
Microsoft.Data.SqlXml.SqlXmlException: Schema: unable to load schema T0020V1.xsd.
An error occurred (globaltypes.xsd#/schema[1]/simpleType[position() = 6 and @name = globalAddressTypeValues]/restriction[1]
Undeclared XSD type : {http://www.test.org/namespaces/Test}string.). --->
System.Runtime.InteropServices.COMException (0x80004005):
Schema: unable to load schema T0020V1.xsd.
An error occurred (globaltypes.xsd#/schema[1]/simpleType[position() = 6 and @name = globalAddressTypeValues]/restriction[1]
Undeclared XSD type : {http://www.test.org/namespaces/Test}string.).
at Microsoft.Data.SqlXml.Common.ISQLXMLCommandManagedInterface.ExecuteToOutputStream()
at Microsoft.Data.SqlXml.SqlXmlCommand.innerExecute(Stream strm)
--- End of inner exception stack trace ---
at Microsoft.Data.SqlXml.SqlXmlCommand.ExecuteStream()
Any help on this would be greatly appreciated
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.test.org/namespaces/Test"
xmlns:ts="http://www.test.org/namespaces/Test"
elementFormDefault="qualified">
<!-- IRP Account Input Transaction, T0020, version 1 -->
<include schemaLocation="globalTypes.xsd"/>
....
Here is the globalTypes.xsd file
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
version="1.0" elementFormDefault="qualified" xml:lang="EN">
<simpleType name="globalAddressTypeValues">
<restriction base="string">
<enumeration value="MA"/>
<enumeration value="PH"/>
</restriction>
</simpleType>
<simpleType name="globalNameTypeValues">
<restriction base="string">
<enumeration value="LG"/>
<enumeration value="DB"/>
</restriction>
</simpleType>
...(etc.)
Here is my error when I try to load the schema
Microsoft.Data.SqlXml.SqlXmlException: Schema: unable to load schema T0020V1.xsd.
An error occurred (globaltypes.xsd#/schema[1]/simpleType[position() = 6 and @name = globalAddressTypeValues]/restriction[1]
Undeclared XSD type : {http://www.test.org/namespaces/Test}string.). --->
System.Runtime.InteropServices.COMException (0x80004005):
Schema: unable to load schema T0020V1.xsd.
An error occurred (globaltypes.xsd#/schema[1]/simpleType[position() = 6 and @name = globalAddressTypeValues]/restriction[1]
Undeclared XSD type : {http://www.test.org/namespaces/Test}string.).
at Microsoft.Data.SqlXml.Common.ISQLXMLCommandManagedInterface.ExecuteToOutputStream()
at Microsoft.Data.SqlXml.SqlXmlCommand.innerExecute(Stream strm)
--- End of inner exception stack trace ---
at Microsoft.Data.SqlXml.SqlXmlCommand.ExecuteStream()
Any help on this would be greatly appreciated