XML Parsing in C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I get an XML and pass it on to the dataset and access it like
dr["Name"], where dr is the datarow of a dataset. This is incase the XML is
like

<name>MyName</name> .. etc

What if i have a complex data say the XML is like

<ns1:nv xsi:type="otherName">
<ns2:nv xmlns:ns2="http://abc/otherName.xsd">ABC</ns2:nval>
<ns3:fcd xmlns:ns3="http://abc/otherName.xsd">RELNM</ns3:fcode>
<ns4:fname xmlns:ns4="http://d/g/otherName.xsd">R NAME</ns4:fname>
<ns5:lname xmlns:ns5="http://i/d/g/otherName.xsd">GAMBIA</ns5:lname>
</ns1:nv>

how do i access nv, fcde,fname,lname through the dataset?
 
Hi:

One way is to get the raw xml using Dataset.GetXML() and then use an
XMLReader or XMLDocument depending on what you are trying to do.

Thanks
 
Back
Top