rodmjay
asked on
The same table cannot be the child table in two nested relations.
I am trying to read an XML file using the Dataset.readxml method. Here is the XML File i am trying to read (simplified)
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE ShopSiteOrders PUBLIC "-//shopsite.com//ShopSite Order DTD//EN" "http://www.shopsite.com/XML/1.2/shopsiteorders.dtd">
<ShopSiteOrders>
<Order>
<Billing>
<NameParts>
<Title />
<FirstName>JO-ANNE</FirstN ame>
<MiddleName />
<LastName>GRANDE</LastName >
<Suffix />
</NameParts>
</Billing>
<Shipping>
<FullName>JO-ANNE GRANDE</FullName>
<NameParts>
<Title />
<FirstName>JO-ANNE</FirstN ame>
<MiddleName />
<LastName>GRANDE</LastName >
<Suffix />
</NameParts>
</Shipping>
</Order>
</ShopSiteOrders>
I keep getting this error when i try to run the command .readxml:
An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll
Additional information: The same table (NameParts) cannot be the child table in two nested relations.
One thing i noticed is that if i change the name of one of the NameParts tables, it works just fine, so if you know how to change the name of one of these table names on the fly that may be an ok workaround although not preferred.
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE ShopSiteOrders PUBLIC "-//shopsite.com//ShopSite
<ShopSiteOrders>
<Order>
<Billing>
<NameParts>
<Title />
<FirstName>JO-ANNE</FirstN
<MiddleName />
<LastName>GRANDE</LastName
<Suffix />
</NameParts>
</Billing>
<Shipping>
<FullName>JO-ANNE GRANDE</FullName>
<NameParts>
<Title />
<FirstName>JO-ANNE</FirstN
<MiddleName />
<LastName>GRANDE</LastName
<Suffix />
</NameParts>
</Shipping>
</Order>
</ShopSiteOrders>
I keep getting this error when i try to run the command .readxml:
An unhandled exception of type 'System.ArgumentException'
Additional information: The same table (NameParts) cannot be the child table in two nested relations.
One thing i noticed is that if i change the name of one of the NameParts tables, it works just fine, so if you know how to change the name of one of these table names on the fly that may be an ok workaround although not preferred.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER