By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,310 Members | 1,430 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,310 IT Pros & Developers. It's quick & easy.

Shared Xml file problem when xsd.exe is used

P: n/a
Raj
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
Nov 11 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
This came up quite a few times before. Check the archives, for example [0]

--
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor

[0]
http://groups.google.com/groups?q=ch...ftngp05&rnum=4

"Raj" <ph*********@yahoo.com> wrote in message
news:26**************************@posting.google.c om...
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

Nov 11 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.