Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Reading XML Data

Posted on 2007-11-30
2
Medium Priority
?
209 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 2000 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

610 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