473,503 Members | 1,643 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Given xsd files, need to send XML with data

Hi,

I have been given a set of xsd files which I need to use to generate XML
files with my data added. I am using the DataSet.ReadXmlSchema() but get the
error:

System.InvalidOperationException: Nested table 'Contact-Address' which
inherits its namespace cannot have multiple parent tables in different
namespaces.

The two questions I have are

1) Is this the best approach?

2) What generates this error?

I have reduced the xsd files to two example files:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:HIP="DCLG-HIP"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:import namespace="DCLG-HIP" schemaLocation="Test.xsd"/>

<xs:element name="InspectorRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="Inspector" type="HIP:Inspector" minOccurs="0"
maxOccurs="unbounded"/>
<xs:element name="Address" type="HIP:AddressType" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

and an element definition xsd file

<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns="DCLG-HIP" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:HIP="DCLG-HIP" targetNamespace="DCLG-HIP"
elementFormDefault="qualified">

<xs:include schemaLocation="MyElements.xsd" />

<xs:element name="Inspector" type="HIP:Inspector" />
<xs:element name="AddressType" type="HIP:AddressType" />

</xs:schema>
Feb 21 '08 #1
1 3536
Hi,

Sorry, the second file should be:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns="DCLG-HIP" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:HIP="DCLG-HIP" targetNamespace="DCLG-HIP"
elementFormDefault="qualified">

<xs:complexType name="Inspector">
<xs:all>
<xs:element name="Contact-Address" type="AddressType" />
</xs:all>
</xs:complexType>

<xs:complexType name="AddressType">
<xs:all>
<xs:element name="Town" type="xs:string" minOccurs="0"/>
</xs:all>
</xs:complexType>

<xs:element name="Inspector" type="HIP:Inspector" />
<xs:element name="AddressType" type="HIP:AddressType" />

</xs:schema>
"David" wrote:
Hi,

I have been given a set of xsd files which I need to use to generate XML
files with my data added. I am using the DataSet.ReadXmlSchema() but get the
error:

System.InvalidOperationException: Nested table 'Contact-Address' which
inherits its namespace cannot have multiple parent tables in different
namespaces.

The two questions I have are

1) Is this the best approach?

2) What generates this error?

I have reduced the xsd files to two example files:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:HIP="DCLG-HIP"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:import namespace="DCLG-HIP" schemaLocation="Test.xsd"/>

<xs:element name="InspectorRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="Inspector" type="HIP:Inspector" minOccurs="0"
maxOccurs="unbounded"/>
<xs:element name="Address" type="HIP:AddressType" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

and an element definition xsd file

<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns="DCLG-HIP" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:HIP="DCLG-HIP" targetNamespace="DCLG-HIP"
elementFormDefault="qualified">

<xs:include schemaLocation="MyElements.xsd" />

<xs:element name="Inspector" type="HIP:Inspector" />
<xs:element name="AddressType" type="HIP:AddressType" />

</xs:schema>

Feb 21 '08 #2

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

Similar topics

1
1901
by: Ruben Duarte | last post by:
Hi, Anybody knows if is posible in Linux with PHP to do upload of several files sending the data before that php script executes. Now in my server you do the upload (with html,form, multipart...
27
4881
by: Eric | last post by:
Assume that disk space is not an issue (the files will be small < 5k in general for the purpose of storing preferences) Assume that transportation to another OS may never occur. Are there...
5
1708
by: Sean | last post by:
Hi, I need to save data into a XML file using an existing schema (I have the ..xsd file) If the record exists then the data must be read from the DB in MS Access 2000 and saved into a XML...
25
12735
by: Ali-R | last post by:
Hi, Is there a parser which parses CSV files? Thanks for your help. Reza
0
793
by: David Helgason | last post by:
I think those best practices threads are a treat to follow (might even consider archiving some of them in a sort of best-practices faq), so here's one more. In coding an game asset server I want...
7
1999
by: jonathandrott | last post by:
sorry newbie question probably. i'm trying to open an specific folder. open each file with in the folder individually and process each one. all the processing code has been written. i'm looking...
21
34322
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
18
34641
jhardman
by: jhardman | last post by:
Have you ever wanted to upload files through a form and thought, "I'd really like to use ASP, it surely has that capability, but the tutorial I used to learn ASP didn't mention how to do this."? ...
221
366957
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7084
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.