Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / February 2008

Tip: Looking for answers? Try searching our database.

Given xsd files, need to send XML with data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David - 21 Feb 2008 17:59 GMT
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>
David - 21 Feb 2008 18:03 GMT
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>

> Hi,
>
[quoted text clipped - 48 lines]
>
> </xs:schema>

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.