Well an XML document does not have records or columns, instead it has nodes like element nodes, attribute nodes, comment nodes, text nodes. You can read out such nodes and determine the names if you want. Here is an example that recursively processes the
elements nodes, starting with the root element and then processing the child elements:
Martin_Honne...
Star
14481 Points
2006 Posts
MVP
Re: read data from xml file using LINQ?
Jan 16, 2009 11:13 AM|LINK
Well an XML document does not have records or columns, instead it has nodes like element nodes, attribute nodes, comment nodes, text nodes. You can read out such nodes and determine the names if you want. Here is an example that recursively processes the elements nodes, starting with the root element and then processing the child elements:
With the XML being
<root> <foo> <bar>bar 1</bar> </foo> <foo> <bar>bar 2</bar> </foo> </root>this C# snippet
outputs
Element named 'root'.
Element named 'foo'.
Element named 'bar'.
Element named 'foo'.
Element named 'bar'.
If that does not help then you need to show us samples of the XML you want to process and tell us exactly which nodes you are interested in.
My blog