473,386 Members | 1,630 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,386 software developers and data experts.

2.0 : fastest read-only forward-only loading method

In 2.0 what is the fastest way to iterate through an element set in a
read-only forward-only XMLDocument ?

For example , load the key/value pairs in the following xml doc into a
hashtable :

<Mappings>
<Mapping MappingKey="AL" MappingValue="Alabama" />
<Mapping MappingKey="CA" MappingValue="Alabama" />
</Mappings>

Mar 28 '06 #1
5 1604


John A Grandy wrote:
In 2.0 what is the fastest way to iterate through an element set in a
read-only forward-only XMLDocument ?


Create an XmlReader and read out the nodes you are looking for. That
assumes you have an XML document in a file or stream. If you already
have a DOM XmlDocument instance then using XPath is an option.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 29 '06 #2
Unless your xml schema is simplistic, I think an XPathReader is typically
necessary ... no ?

"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:eW**************@TK2MSFTNGP09.phx.gbl...


John A Grandy wrote:
In 2.0 what is the fastest way to iterate through an element set in a
read-only forward-only XMLDocument ?


Create an XmlReader and read out the nodes you are looking for. That
assumes you have an XML document in a file or stream. If you already have
a DOM XmlDocument instance then using XPath is an option.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Apr 19 '06 #3


John A Grandy wrote:
Unless your xml schema is simplistic, I think an XPathReader is typically
necessary ... no ?


You asked the following:
In 2.0 what is the fastest way to iterate through an element set in a
read-only forward-only XMLDocument ?


For read-only forward-only fastest reading an XmlReader is the tool.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Apr 20 '06 #4
Right, but what if the element set you wish to iterate through is buried in
a complex XML hierarchy ...

"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:Of**************@TK2MSFTNGP04.phx.gbl...


John A Grandy wrote:
Unless your xml schema is simplistic, I think an XPathReader is typically
necessary ... no ?


You asked the following:
In 2.0 what is the fastest way to iterate through an element set in a
read-only forward-only XMLDocument ?


For read-only forward-only fastest reading an XmlReader is the tool.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Apr 21 '06 #5


John A Grandy wrote:
Right, but what if the element set you wish to iterate through is buried in
a complex XML hierarchy ...


Well Xml(Text)Reader pulls in node by node so it is capable with dealing
with a complex XML hierarchy, you simply need to make sure your code
using the reader finds what it is looking for.
I don't think we will get far by discussing further without knowing the
XML markup you have in mind so feel free to post a URL for instance. Of
course you can use XPath if you want to, it is not that my suggestion
was meant to rule XPath out.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Apr 21 '06 #6

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

Similar topics

6
by: Neal D. Becker | last post by:
I need a fairly small lookup table, and I'm wondering which data python data structure would be fastest. I could use a list, tuple, dictionary, numeric array, or maybe plain python array. The...
3
by: SteveC | last post by:
Looking for any input on the fastest and most thread-safe way to read some small (~8k) XML files from a local disk. System.Xml.XmlTextReader xReader = new XmlTextReader( new...
9
by: Jiho Han | last post by:
Suppose I have an xml fragment like: <mother> <child name="Bob" sex="M"/> <child name="Jane" sex="F"/> ... </mother> If I wanted to replace the <mother> element to <father> element, what is...
0
by: Einar Høst | last post by:
Hi, I'm reading data from a text file, and having read a bit on performance and memory, I'm wondering how it could be done in the fastest, most frugal way. The data comes in messages, one per...
1
by: Thomas | last post by:
Hi all, Is there a faster way to read image dimensions other than something like: ImageOrig = System.Drawing.Image.FromFile(Filepath); ImageOrigHeight = ImageOrig.Height; ImageOrigWidth =...
11
by: Ignacio X. Domínguez | last post by:
Hi. I'm developing a desktop application that needs to store some data in a local file. Let's say for example that I want to have an address book with names and phone numbers in a file. I would...
9
by: sshock | last post by:
Hi all, I want to read from a file into a vector<unsigned char>. Right now my code looks like this: FILE* f = fopen( "datafile", "rb" ); enum { SIZE = 100 }; vector<unsigned char>...
6
by: Klaas Vantournhout | last post by:
Hi, I have a question, which is just out of interest. What is the fastest way to do an odd/even check with c++ and if needed assembler. Assume n is an unsigned integer like type (unsigned...
21
by: Pieter | last post by:
Hi, I need some type of array/list/... In which I can store objects together with a unique key. The most important thing is performance: I will need to do the whole time searches in the list of...
0
by: dantz | last post by:
After reading all of the materials in msdn about interprocess communication now I am confused. I hope someone can give me some enlightment. I am developing a multithreaded client-server...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.