nobody <no****@nowhere.org> wrote:
: Milo Woodward wrote:
:> I can't read C# very well - I need to pull the xml file out a
:> directory (eg: C:\XML). Does your example go to the end of file or
:> cycle through each line? These files are 200MB +. I appreciate your
:> help!
: maybe this could do the job for you:
:
http://www.gotdotnet.com/Community/U...8-A20F46A38412
If indeed your XML data have a regular structure, like in
<top>
<rec id="a0"><cont>foo</cont></rec>
<rec id="a2"><cont>bar</cont></rec>
</top>
a SAX parser would be a small and efficient way to count the rec
elements. You just write a callback for the rec element
which increases a counter. The needed SAX parser functionality should be
available in any of today's Windows, in MSXML. Some snippets from
Microsoft texts:
"Dim reader As New SAXXMLReader"
then, "create the ContentHandler by adding a class that implements
the IVBSAXContentHandler interface."
There is introductory material which says that the Visual Basic tools
will assist in most of the mechanical aspects of this, see the MSDN.
HTH, Georg