Solved

Reading XML Data

Posted on 2007-11-30
2
197 Views
Last Modified: 2013-11-07
Im trying to process data from a very large XML file from a file system... I was looking at XmlValidatingReader but someone said it was out dated. Whats faster?

XmlValidatingReader
XmlTextReader
XMLNodeReader

Someone said use the "XMLReader class and call the Create method to create a new instance" but not sure why
0
Comment
Question by:cybernation989
2 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
ID: 20381103
xmltextreader is faster. It reads one element at a time.
The Create method opens a new stream, the use Read to read one element, use a while to iterate though all elements. This will process any-size xml with maximum performance.
0
 
LVL 3

Expert Comment

by:wizrr
ID: 20381138
Create method is factory method and used to create appropriate instance of XmlReader depending on your stream and parameters. There can be any type of streams (network, or file system) with any encoding. Created XmlReader class will depend on parameters you passed here. That can be XmlTextReaderImpl without validation, with Dtd validation, or XsdValidatingReader. Encoding will be determined automatically.

You always can use Lutz Roeder's .NET Reflector and disassembly .NET code in any language you want, to know what method actually does.

Good luck.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now