System.IO.FileStream xmfile= File.Open(namefilexml ,
FileMode.Open);
using (XmlReader reader = XmlReader.Create(xmfile))
{
....
}
but I don't know how to navigate inside reader (ie read the aaa/bbb[ccc]
value for example).
Can you provide a small example to do this ?
thanks
XmlReader is quite low level class, where you need to manually walk through
the document and until you come to what you are looking for.
For working with XmlReader, some general info could be found at
http://msdn.microsoft.com/en-us/library/9d83k261.aspx
So it would basically be something like...
reader.ReadStartElement("aaa");
reader.ReadStartElement("bbb");
return reader.GetAttribute("ccc");
(but this does not handle different elements order, in which case you would
use overloads without specifying the element names and testing them
yourself)
Jan
"TMC" <T...@discussions.microsoft.com> wrote in message
news:E49D4F23-EAD3-45C7...@microsoft.com...
"Jan Kučera" wrote:
> .
>
If you are dealing with a XHTML page, then XmlReader might be quite helpful
in cases when the page is valid XML, which usually is. This would be also my
recommendation if you are creating the pages you are going to parse
yourself.
Otherwise depends on why do you need to parse the HTML files. If you are
looking for concrete information in some more or less fixed structure, then
the easiest way might work good and fast enough - plain string search.
Maybe if you could tell us more about your scenario, we could come with some
ideas.
Jan
"TMC" <T...@discussions.microsoft.com> wrote in message
news:FD1B3004-6D3B-4E2E...@microsoft.com...
"Jan Kučera" wrote:
> .
>