473,382 Members | 1,290 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Fast XML Document Parsing?

I currently parse an xml document using the XmlTestReader class. The
xml doc contains several records, each of which contains about 10
elements. I then convert each element in a record into its equivalent
C# data type (e.g. for float values, I use float.Parse(elementVal) )

I then perform calculations using each of these converted values
before overwriting the values when the next xml record is parsed.

Is this the best technique?

<rec>
<val1>
<val2>
<val3>
</rec>
<rec>
<val1>
<val2>
<val3>
</rec>
Nov 12 '05 #1
1 1818
Depends how many of the values you convert and how many times you update
each instance in memory. If the document stays loaded for a long time and
you update all the values many times, then it would be better to convert the
XML to an object graph so that you do the conversion once at serialization
time. If you only update a few values then stream the document back out
then the XmlTextReader/XmlTextWriter is the most efficient.

"Sean Hearne" <sh*****@tssg.org> wrote in message
news:ca**************************@posting.google.c om...
I currently parse an xml document using the XmlTestReader class. The
xml doc contains several records, each of which contains about 10
elements. I then convert each element in a record into its equivalent
C# data type (e.g. for float values, I use float.Parse(elementVal) )

I then perform calculations using each of these converted values
before overwriting the values when the next xml record is parsed.

Is this the best technique?

<rec>
<val1>
<val2>
<val3>
</rec>
<rec>
<val1>
<val2>
<val3>
</rec>

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: PedroX | last post by:
Hello: I need to parse some large XML files, and save the data in an Access DB. I was using MSXML 2 and ASP, but it turns out to be extremely slow when then XML documents are like 10 mb in...
10
by: Simon Brooke | last post by:
The DOM API has included public Node importNode(Node,boolean) as a method of the Document interface for a long time. Does anything actually implement it? Xerces 2 is giving me: ...
5
by: Marian Steinbach | last post by:
Howdy! I am just switching from PHP4 to PHP5. Since there are many different ways to create XML in PHP5, I'd like to know from the community which one would be suited best for a REST web service...
2
by: nicky123 | last post by:
Hi everyone, This is a brief description that I have provided for parsing & displaying an XML document using DOM API. Please feel free to post your own comments & views regarding...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.