Solved

Reading XML Data

Posted on 2007-11-30
2
200 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

808 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