473,386 Members | 1,766 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.

XML Nodes conversion to Hashtable


Hi m not able to convert the node values of a XML file to Hashtable

Actaully i need to traverse the XML Nodes again and again and want to pick
values
on filters

what i want is to stroe the XML values in the Hashtable and return then from
Hashtable (the hashtable will be filled only once)
this will optimise the performance because the XML is not updated (or
updated rarely)

Thanks in advance

Nov 25 '06 #1
3 5954
On Sat, 25 Nov 2006 04:59:01 -0800, Manish wrote:
Hi m not able to convert the node values of a XML file to Hashtable

Actaully i need to traverse the XML Nodes again and again and want to pick
values
on filters

what i want is to stroe the XML values in the Hashtable and return then from
Hashtable (the hashtable will be filled only once)
this will optimise the performance because the XML is not updated (or
updated rarely)

Thanks in advance
I assume you always know the exact key of the items you wish to locate in
the hash table, otherwise a hash table will not work as you can't iterate
through its contents. Perhaps you need a List<instead?
What is the problem you are having? XML files don't have nodes, so what
have you read the file into? Assuming you've loaded it into an XmlDocument
then you can just recurse down the tree and add the nodes to the hash
table.

Please explain where you're having difficulty.

Cheers,
Gadget
Nov 29 '06 #2
Hi Gadget
>
Let me explain my problem first

I have an XML File (Containing information about my application
configuration it is other than app.config file)

i have to read this file many a times in the application but the file is
updated very rarely.

so what i want is when the application starts i will load this XML file
completely into a HashTable (because retrieving information from HashTable
will be must optimised way) and whenever an updation in the file occurs i
will reload the XML file into the same Hash Table.

For this i need to Load the XML document into the XMLDocument
now i have to traverse through the XMLDocument completely and write its
individual node values to the HashTable
So this is the actual scenario
Well this is a requirement, not a problem.
What is the *problem* you are having? I don't see anything complex here.

Cheers,
Gadget
Dec 4 '06 #3
That is what my problem is
How to convert an XML Document to a HashTable entry??????
i need code of it in VB.Net (if possible)
"Gadget" wrote:
Hi Gadget

Let me explain my problem first

I have an XML File (Containing information about my application
configuration it is other than app.config file)

i have to read this file many a times in the application but the file is
updated very rarely.

so what i want is when the application starts i will load this XML file
completely into a HashTable (because retrieving information from HashTable
will be must optimised way) and whenever an updation in the file occurs i
will reload the XML file into the same Hash Table.

For this i need to Load the XML document into the XMLDocument
now i have to traverse through the XMLDocument completely and write its
individual node values to the HashTable
So this is the actual scenario

Well this is a requirement, not a problem.
What is the *problem* you are having? I don't see anything complex here.

Cheers,
Gadget
Dec 4 '06 #4

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

Similar topics

22
by: anon | last post by:
How can following two statement be the same? (1) using System.l1001 (2) using System.Globalization; That is, how does the compilier know these two representations, at the using...
3
by: Earl Teigrob | last post by:
I am considering writing a Class that Selects, Adds, Updates and Deletes Nodes in an XML File but do not what to reinvent the wheel. (See XML file below) That data format would emulate records...
1
by: wei | last post by:
how to get value by key in a hashtable? help: how to convert the piece of VB code to c#? If TypeOf pMap.SpatialReference Is IProjectedCoordinateSystem thank you!
5
by: francois | last post by:
First of all I would to to apologize for resending this post again but I feel like my last post as been spoiled Here I go for my problem: Hi, I have a webservice that I am using and I would...
8
by: Dgates | last post by:
Has anyone typed up an index for the O'Reilly book "C# and VB.NET Conversion?" I'm just learning C#, and often using this little book to see which VB.NET terms translate directly to some term in...
3
by: Vinay Agarwal | last post by:
Hello, I am using Hashtable class in my application to store key/value pairs. It works great except the types returned are all objects. As a result, there are type-casts everywhere making the...
1
by: SamSpade | last post by:
I want to expand nodes on a treeview. What I have is an array (SubFolder) of node.text not index. What I'd like to do is the folowing: lKey = tvFolders.Nodes(0) ) 'Not in SubFolder For...
0
by: David R. | last post by:
I found a script that converts a regular size image to a thumbnail. It's a wonderful script, except the thumbnail quality is a bit low. I'd like to add the following code to improve the output...
0
by: David R. | last post by:
I found a script that converts a regular size image to a thumbnail. It's a wonderful script, except the thumbnail quality is a bit low. I'd like to add the following code to improve the output...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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,...
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.