Hi,
I hope someone can please help me. I'm having a lot of trouble with
schema files in .NET. I have produced a very simple example that uses
"include" to include other schema files. It all works with SPY, but
when I pick "Validate Schema" from the .NET 2003 menu, it fails with
message:
"Type XType is not declared." As I hinted at in my subject line, I
suspect that it has to do with including another schema multiple times.
Can someone tell me how this should be done? Possibly, SPY or .NET do
not conform to the standard. Is there a reference somewhere to this.
I'm somewhat at others mercy as the schema files are given to us by a
third party that claims, "hey they work with SPY!". If I can come up
with a specific solution though, I can probably force them to comply.
Here are the scema files. Notice I include Common_dataTypes.xsd in the
main schema AND I include it in common_PointRecord.xsd
which is itself included in RecordOfInterest.xsd
which is in turn included in main.xsd. Again, I suspect that include
files twice is the real problem. Is there a limit or rule on multiple
includes of schema files?
Any help would be greatly appreciated.
Thanks,
Andrew
main.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://test/schemas"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://test/schemas" elementFormDefault="qualified">
<xsd:include schemaLocation="Common_dataTypes.xsd"/>
<xsd:include schemaLocation="RecordOfInterest.xsd"/>
<xsd:element name="PRIMARY_QUERY">
<xsd:complexType>
<xsd:all>
<xsd:element name="Id" type="standardIdentifierType"/>
<xsd:element name="RecordOfInterestobj" type="RecordOfInterest"
minOccurs="0"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:schema>
commonDataTypes.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xsd:simpleType name="XType">
<xsd:restriction base="xsd:double">
<xsd:minInclusive value="-10.0"/>
<xsd:maxInclusive value="10.0"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="YType">
<xsd:restriction base="xsd:double">
<xsd:minInclusive value="-18.0"/>
<xsd:maxInclusive value="18.0"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="standardIdentifierType">
<xsd:restriction base="xsd:token">
<xsd:maxLength value="128"/>
<xsd:minLength value="1"/>
<xsd:pattern value="[0-9A-Za-z_\.\-]+"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
RecordOfInterest.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://test/schemas"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://test/schemas" elementFormDefault="qualified">
<xsd:include schemaLocation="common_PointRecord.xsd"/>
<xsd:complexType name="RecordOfInterest">
<xsd:all>
<xsd:element name="DATA">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="TempData" type="PointRecord" minOccurs="3"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:schema>
common_PointRecord.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xsd:include schemaLocation="Common_dataTypes.xsd"/>
<xsd:complexType name="PointRecord">
<xsd:all>
<xsd:element name="X" type="XType">
</xsd:element>
<xsd:element name="Y" type="YType">
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:schema> 4 2254
This is a known issue regarding chameleon includes in .net framework 1.1.
This is fixed .net framework 2.0 in the new schema store - XmlSchemaSet.
Thanks,
Zafar
<bi*********@yahoo.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com... Hi,
I hope someone can please help me. I'm having a lot of trouble with schema files in .NET. I have produced a very simple example that uses "include" to include other schema files. It all works with SPY, but when I pick "Validate Schema" from the .NET 2003 menu, it fails with message:
"Type XType is not declared." As I hinted at in my subject line, I suspect that it has to do with including another schema multiple times. Can someone tell me how this should be done? Possibly, SPY or .NET do not conform to the standard. Is there a reference somewhere to this. I'm somewhat at others mercy as the schema files are given to us by a third party that claims, "hey they work with SPY!". If I can come up with a specific solution though, I can probably force them to comply.
Here are the scema files. Notice I include Common_dataTypes.xsd in the main schema AND I include it in common_PointRecord.xsd which is itself included in RecordOfInterest.xsd which is in turn included in main.xsd. Again, I suspect that include files twice is the real problem. Is there a limit or rule on multiple includes of schema files?
Any help would be greatly appreciated.
Thanks,
Andrew
main.xsd <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns="http://test/schemas" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test/schemas" elementFormDefault="qualified"> <xsd:include schemaLocation="Common_dataTypes.xsd"/> <xsd:include schemaLocation="RecordOfInterest.xsd"/> <xsd:element name="PRIMARY_QUERY"> <xsd:complexType> <xsd:all> <xsd:element name="Id" type="standardIdentifierType"/> <xsd:element name="RecordOfInterestobj" type="RecordOfInterest" minOccurs="0"/> </xsd:all> </xsd:complexType> </xsd:element> </xsd:schema> commonDataTypes.xsd <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xsd:simpleType name="XType"> <xsd:restriction base="xsd:double"> <xsd:minInclusive value="-10.0"/> <xsd:maxInclusive value="10.0"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="YType"> <xsd:restriction base="xsd:double"> <xsd:minInclusive value="-18.0"/> <xsd:maxInclusive value="18.0"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="standardIdentifierType"> <xsd:restriction base="xsd:token"> <xsd:maxLength value="128"/> <xsd:minLength value="1"/> <xsd:pattern value="[0-9A-Za-z_\.\-]+"/> </xsd:restriction> </xsd:simpleType> </xsd:schema>
RecordOfInterest.xsd <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns="http://test/schemas" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test/schemas" elementFormDefault="qualified"> <xsd:include schemaLocation="common_PointRecord.xsd"/> <xsd:complexType name="RecordOfInterest"> <xsd:all> <xsd:element name="DATA"> <xsd:complexType> <xsd:sequence> <xsd:element name="TempData" type="PointRecord" minOccurs="3" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:all> </xsd:complexType> </xsd:schema>
common_PointRecord.xsd <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xsd:include schemaLocation="Common_dataTypes.xsd"/> <xsd:complexType name="PointRecord"> <xsd:all> <xsd:element name="X" type="XType"> </xsd:element> <xsd:element name="Y" type="YType"> </xsd:element> </xsd:all> </xsd:complexType> </xsd:schema>
Zafar,
Thanks for the response.
Can you give me an example of how to fix the problem? I did some
checking, and the term "targetNamespace" came up. I tried adding the
same targetNamespace to all child schemas without success. That is, I
added "targetNamespace="http://test/schemas"" to all the schemas. Is
there something else I need to do?
Thank you,
Andrew
Add this to the xs:schema element in the common_PointRecord.xsd schema.
targetNamespace="http://test/schemas" xmlns="http://test/schemas"
-Zafar
<bi*********@yahoo.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com... Zafar,
Thanks for the response.
Can you give me an example of how to fix the problem? I did some checking, and the term "targetNamespace" came up. I tried adding the same targetNamespace to all child schemas without success. That is, I added "targetNamespace="http://test/schemas"" to all the schemas. Is there something else I need to do?
Thank you,
Andrew
Thanks Zafar!
That works.
Andrew This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Group IIS |
last post by:
Hi all,
I am using ALTOVA XMLSpy.
The start of my XML file looks like this:
<?xml version="1.0" encoding="UTF-8" ?>
<Submission xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...
|
by: stiank81 |
last post by:
Hi.
I have a problem witch I assume there is an answear to....?
I have several XML schemas, and they all have quiet a lot of
definitions in common. They still have to be seperated into...
|
by: MR |
last post by:
Is there a way to load an XML schema into a dataset from a resource or other
object? I am using ReadXmlSchema(filename) and that works fine.
However, I have many XSD files that I would rather not...
|
by: Wallace |
last post by:
Hi all,
I have a problem on validating a xml fragment using a single namespace
schema which spread across multiple schema files using include in the
master schema file. No matter how I change...
|
by: Buggyman |
last post by:
Hi,
I'm having trouble validating an intranet URL.
I'm using the regular expresssion validator (though any ideas accepted), and
using the standard Internet URL definition, which is.....
|
by: Jonas Bush |
last post by:
I've got the some code to try and validate some xml. Against my schema,
the "Good" xml (below) produces a couple of warnings, which I don't
care about. The "Bad" xml (also below), produces warnings...
|
by: josh |
last post by:
Hi,
I am trying to validate cXML documents against cXML.dtd using the
XmlValidatingReader. If I set the XMLValidatingReader's ValidatingType
to ValidationType.DTD, I get the following...
|
by: jh3an |
last post by:
Please give me your advice!
I made two files according to xml book, but when validating these two
files,
it gives me an error that I totally don't understand.
Is there a problem in these...
|
by: bowlderyu |
last post by:
Hello, all.
I meet a question about compiling files.
Eg., I have three files named myfile.h, myfile.c and the main.c file,
and there is a function, ex, void myfun(...).
If I put myfun(...) in...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |