D
davis
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 "<ShipmentHeader>" level, each of
which have a number of child nodes. I will not know ahead of time
which of these parent/child node relationships will occur. I have
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>xxxxx</DomainName>
<Xid>xxxxxxx</Xid>
</Gid>
</ShipmentGid>
<ShipmentRefnum>
<ShipmentRefnumQualifierGid>
<Gid>
<Xid>xxxxx</Xid>
</Gid>
</ShipmentRefnumQualifierGid>
<ShipmentRefnumValue>xxxxx</ShipmentRefnumValue>
<ShipmentRefnum>xxxxx</ShipmentRefnum>
<ShipmentRefnumQualifierGid>
<Gid>
<Xid>xxxx</Xid>
</Gid>
</ShipmentRefnumQualifierGid>
<ShipmentRefnumValue>xxxxxx</ShipmentRefnumValue>
</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 "<ShipmentHeader>" level, each of
which have a number of child nodes. I will not know ahead of time
which of these parent/child node relationships will occur. I have
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>xxxxx</DomainName>
<Xid>xxxxxxx</Xid>
</Gid>
</ShipmentGid>
<ShipmentRefnum>
<ShipmentRefnumQualifierGid>
<Gid>
<Xid>xxxxx</Xid>
</Gid>
</ShipmentRefnumQualifierGid>
<ShipmentRefnumValue>xxxxx</ShipmentRefnumValue>
<ShipmentRefnum>xxxxx</ShipmentRefnum>
<ShipmentRefnumQualifierGid>
<Gid>
<Xid>xxxx</Xid>
</Gid>
</ShipmentRefnumQualifierGid>
<ShipmentRefnumValue>xxxxxx</ShipmentRefnumValue>
</ShipmentRefnum>
</ShipmentHeader>
</Shipment>