XML Iteration

XML Iteration

am 04.01.2008 18:53:19 von Larry Bud

I have a client who is sending XML to us. Some of the data element
could be 5 or 6 levels deep. Some elements may be repeated more than
once for a given Master record. i.e.

row1
somedata
moredata
row2
somedata
moredata1
moredata2

What is the best .net method in traversing this data? xmlreader?
Dataset? Something I haven't though of? Tia.

RE: XML Iteration

am 04.01.2008 20:40:01 von pbromberg

The "traditional" way would be to load the Xml data into an instance of the
XmlDocument class and use XPATH expressions to query it. You could "try"
loading it into a DataSet with ReadXml but from your description it would
probably fail. You can also use LINQ to XML.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com


"Larry Bud" wrote:

> I have a client who is sending XML to us. Some of the data element
> could be 5 or 6 levels deep. Some elements may be repeated more than
> once for a given Master record. i.e.
>
> row1
> somedata
> moredata
> row2
> somedata
> moredata1
> moredata2
>
> What is the best .net method in traversing this data? xmlreader?
> Dataset? Something I haven't though of? Tia.
>