473,505 Members | 16,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1825
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
4032
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
8770
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
2802
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
2642
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...
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7103
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7307
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7021
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4701
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.