473,327 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

readxmlschema errors

I have been using a typed-dataset for some time. I recentlydecided to see if I could port the implementation to be based onan XML flat file. Neither the .xsd that the dataset is generatedfrom nor an .xsd created from the dataset in memory readscleanly. In both cases, I get a "Invalid 'key' node in keyref'error. I've tried several things, but I have no idea where to gonext. Is there something wrong with my .xsd that I'moverlooking?

Attached is the relevant subset of my XSD. The error is reportedin the KeyGalleryImageRef. Any help would be appreciated.

<?xml version="1.0" standalone="yes" ?>
<xs:schema id="PortfolioDataSet"targetNamespace="http://www.tempuri.org/PortfolioDataSet.xsd"xmlns:mstns="http://www.tempuri.org/PortfolioDataSet.xsd"xmlns="http://www.tempuri.org/PortfolioDataSet.xsd"xmlns:xs="http://www.w3.org/2001/XMLSchema"xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"attributeFormDefault="qualified"elementForm Default="qualified">
<xs:element name="PortfolioDataSet" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="tblImage">
<xs:complexType>
<xs:sequence>
<xs:element name="SetId" type="xs:int" />
<xs:element name="Id" msdata:ReadOnly="true"msdata:AutoIncrement="true" type="xs:int" />
<xs:element name="Name" type="xs:string"minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="tblGallery">
<xs:complexType>
<xs:sequence>
<xs:element name="SetId" type="xs:int" />
<xs:element name="Id" msdata:ReadOnly="true"msdata:AutoIncrement="true" type="xs:int" />
<xs:element name="Name" type="xs:string"minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="tblGalleryImage">
<xs:complexType>
<xs:sequence>
<xs:element name="SetId" type="xs:int" />
<xs:element name="ImageId" type="xs:int" />
<xs:element name="GalleryId" type="xs:int"/>
<xs:element name="Priority" type="xs:int"minOccurs="0" />
<xs:element name="StatusId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>

<xs:unique name="KeyImage" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:tblImage" />
<xs:field xpath="mstns:SetId" />
<xs:field xpath="mstns:Id" />
</xs:unique>
<xs:unique name="KeyGallery" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:tblGallery" />
<xs:field xpath="mstns:SetId" />
<xs:field xpath="mstns:Id" />
</xs:unique>
<xs:unique name="KeyGalleryImage"msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:tblGalleryImage" />
<xs:field xpath="mstns:SetId" />
<xs:field xpath="mstns:ImageId" />
<xs:field xpath="mstns:GalleryId" />
</xs:unique>

<xs:keyref name="KeyGalleryImageRef" refer="KeyGallery">
<xs:selector xpath=".//mstns:tblGalleryImage" />
<xs:field xpath="mstns:SetId" />
<xs:field xpath="mstns:GalleryId" />
</xs:keyref>
<xs:keyref name="KeyImageGalleryRef" refer="KeyImage">
<xs:selector xpath=".//mstns:tblGalleryImage" />
<xs:field xpath="mstns:SetId" />
<xs:field xpath="mstns:ImageId" />
</xs:keyref>
</xs:element>
</xs:schema>
--------------------------------
From: Jordan Breckenridges

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>8R/u22jcq0mL4olba9cDgw==</Id>
Nov 12 '05 #1
0 1180

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: DraguVaso | last post by:
Hi, I should use XML to synchronize the data from different (VB.NET) applications, and I was just wondering which Overloads of these functions ( ReadXmlSchema, ReadXml and WriteXml) goes the...
0
by: Pete | last post by:
I am trying to load a DataSet from an xml file that has 2 tables in it. Any help would be great. Here is the C# code snipit on how I load it. Instead of geting a dataset with 2 table I am...
0
by: Greg | last post by:
I'm trying to use the ReadXmlSchema method of the DataSet class from behind a firewall/proxy server and can't get it to work. I can run the code on a machine not behind the firewall and it works...
0
by: Patrick Kearney | last post by:
Hi All, I have seen this type of question raised in various groups but no one has supplied a definitive answer. I am trying to load a dataset schema that has an xs:include. Project policy is to...
0
by: Eric van Wijk | last post by:
Hi, When I try to assign a schema to a dataset using the ReadXmlSchema method, that schema does not import any schemas included with xs:import. Both schema's are stored in the assembly as...
1
by: Tarun Upadhyay | last post by:
I am trying to read the standard UDDI schema using a DataSet. however, it always chokes with error. Here are the full details: Schema used: http://uddi.org/schema/uddi_v3.xsd C# (.NET) calls...
0
by: Tim Nelson | last post by:
I've got an XML document I am loading into a dataset using ..ReadXml/.ReadXmlSchema. The dataset looks perfect and I can bind it to a datagrid and elements appear as tables and attributes appear...
1
by: JG | last post by:
Hi, I have a quick question regarding the proper use of ReadXmlSchema. For example I have the following code. DataSet ds = new DataSet(); ds.ReadXmlSchema("c:\\XMLInputFile.xsd"); I was...
13
by: Jerry C | last post by:
I am using some sample code from gotdotnet to Create DataSet mappings from a xsd schema. I am geting this error. code and error below. I might mention there is also a publictypelibrary file with...
2
by: Sambo | last post by:
Hi All I've had a look around and noticed a couple of others having this issue, but with no replies. Hopefully someone can help with this. I have a schema (let's call it "Schema1.xsd") that I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
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...
1
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)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.