Hello, I am working in .Net C# and have an xml file similar to the one
below. I have tried using a DataSet but get the error "The same table
(Gid) cannot be the child table in two nested relations". The file
has a number of parent nodes at the "<ShipmentHeade r>" level, each of
which have a number of child nodes. I will not know ahead of time
which of these parent/child nodes will occur. I have also looked at
the XmlTextReader, but it looks like I would have to evaluate
NodeTypes, ReadInnerXml, etc. Is there an easier way?
<?xml version="1.0" encoding="UTF-8" ?>
<Shipment>
<ShipmentHeader >
<ShipmentGid>
<Gid>
<DomainName>xxx xx</DomainName>
<Xid>xxxxxxx</Xid>
</Gid>
</ShipmentGid>
<ShipmentRefnum >
<ShipmentRefnum QualifierGid>
<Gid>
<Xid>xxxxx</Xid>
</Gid>
</ShipmentRefnumQ ualifierGid>
<ShipmentRefnum Value>xxxxx</ShipmentRefnumV alue>
<ShipmentRefnum >xxxxx</ShipmentRefnum>
<ShipmentRefnum QualifierGid>
<Gid>
<Xid>xxxx</Xid>
</Gid>
</ShipmentRefnumQ ualifierGid>
<ShipmentRefnum Value>xxxxxx</ShipmentRefnumV alue>
</ShipmentRefnum>
</ShipmentHeader>
</Shipment>
below. I have tried using a DataSet but get the error "The same table
(Gid) cannot be the child table in two nested relations". The file
has a number of parent nodes at the "<ShipmentHeade r>" level, each of
which have a number of child nodes. I will not know ahead of time
which of these parent/child nodes will occur. I have also looked at
the XmlTextReader, but it looks like I would have to evaluate
NodeTypes, ReadInnerXml, etc. Is there an easier way?
<?xml version="1.0" encoding="UTF-8" ?>
<Shipment>
<ShipmentHeader >
<ShipmentGid>
<Gid>
<DomainName>xxx xx</DomainName>
<Xid>xxxxxxx</Xid>
</Gid>
</ShipmentGid>
<ShipmentRefnum >
<ShipmentRefnum QualifierGid>
<Gid>
<Xid>xxxxx</Xid>
</Gid>
</ShipmentRefnumQ ualifierGid>
<ShipmentRefnum Value>xxxxx</ShipmentRefnumV alue>
<ShipmentRefnum >xxxxx</ShipmentRefnum>
<ShipmentRefnum QualifierGid>
<Gid>
<Xid>xxxx</Xid>
</Gid>
</ShipmentRefnumQ ualifierGid>
<ShipmentRefnum Value>xxxxxx</ShipmentRefnumV alue>
</ShipmentRefnum>
</ShipmentHeader>
</Shipment>
Comment