Hi All,
I am having three XML files. One called SimpleTypes.xsd from which
ComplexTypes.xsd is constructed. Then, there is another file called
InformationExchangeModel.xsd that uses types in complexTypes.xsd to
construct messages.
I am having all sorts of problems validating these xsd files in XML
spy version 5 release 4. It always complains about "undefined value
for 'type' encountered".
Here is the scenario
SimpleTypes.xsd
****************
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:simpleType name="URLType">
<xs:restriction base="xs:string">
<xs:maxLength value="1024"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
ComplexTypes.xsd
*****************
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNameSpace="http://www.x.com/schema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:include schemaLocation="http://www.x.com/SimpleTypes.xsd"/>
<xs:complexType name="StreamURLType">
<xs:sequence>
<xs:element name="URL" type="URLType"/> <---- GIVES ERROR HERE
!!!
<xs:element name="BandWidthK" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:unsignedInt">
<xs:maxInclusive value="2048"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
InformationExchangeModel.xsd
****************************
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.x.com/schema" xmlns:rmt="rmt"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified"
id="rmt_message">
<xs:import namespace="rmt"
schemaLocation="http://dev.radiotime.com/RMTSchema/RadioMytime_ComplexTypes.xsd"/>
<xs:element name="ScheduleResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Header" type="rmt:HeaderType"/>
<xs:element name="ClientID" type="rmt:ClientIDType"/>
<xs:element name="ReturnCode" type="rmt:ReturnCodeType"/>
<xs:element name="ScheduleItemList"
type="rmt:ScheduleItemGroupType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
please assume that all the other types that are referred to are
defined in the complextypes file.
I had earlier import statements for complex and informationmodel.xsd
but when I ran xsd.exe it put everything in different namespaces. When
I just have xs:include, it complains that the namespace '' has already
been included. That is the reason I changed the files and to have one
namespace, from the on I have been having problems
Can someone suggest a better way to do this
Thanks
Raj