Friday, March 16, 2012

Looping through XML Nodes

Can anyone please provide vb.net code to extract data from an XML docuement
with a structure that looks like this please? Note that some of the nodes ma
y contain null values. All my attempts have failed! Thanks.
<A>
<B data="abc">
<C data="efg">
<D> data1 </D>
<D> data2 </D>
<D> data3 </D>
</C>
<C data="hij">
<D> data4 </D>
<D> data5 </D>
<D> data6 </D>
</C>
</B>
<B data="klm">
<C data="nop">
<D> data7 </D>
<D> data8 </D>
<D> data9 </D>
</C>
<C data="qrs">
<D> data10 </D>
<D> data11 </D>
<D> data12 </D>
</C>
</B>
</B>Deep Wrote :
You can use LOAD method of MSXML object to load if xml file else use LODXML
for string.
"BeWyched" wrote:

> Can anyone please provide vb.net code to extract data from an XML docuemen
t with a structure that looks like this please? Note that some of the nodes
may contain null values. All my attempts have failed! Thanks.
> <A>
> <B data="abc">
> <C data="efg">
> <D> data1 </D>
> <D> data2 </D>
> <D> data3 </D>
> </C>
> <C data="hij">
> <D> data4 </D>
> <D> data5 </D>
> <D> data6 </D>
> </C>
> </B>
> <B data="klm">
> <C data="nop">
> <D> data7 </D>
> <D> data8 </D>
> <D> data9 </D>
> </C>
> <C data="qrs">
> <D> data10 </D>
> <D> data11 </D>
> <D> data12 </D>
> </C>
> </B>
> </B>

0 comments:

Post a Comment