473,657 Members | 2,385 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5970
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
1423
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 declaration level, are the same? Thanks.
3
3321
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 in a Database Table with a Primary Key for each Record (see xml sample below) and a flat file structure. I would use a class to manipulate this type of data structure extensivly if I had one. Does anyone know of such an animal?
1
1401
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
2816
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 like it to return an XML serialized version of an object.
8
2189
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 C#. However, it's a real hassle that the book has no index, just a table of contents. For example, as early as page 8, the book teaches that C#'s "using" statement is the equivalent of VB.NET's "imports" statement. However, that concept...
3
1678
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 code very hard to read. I believe it should be relatively easy to derive a class from Hashtable that returns appropriate types for my application. I started writing it like this public class PeerTable : Hashtable { public new PeerTable Clone() {
1
1652
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 lLpCnt = 0 To UBound(lSubFolder) - 1 lKey.Expand() 'But do not expand the last node
0
1154
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 quality of the thumbnail. Can someone direct me where to incorporate this code? Thanks. Code to insert: graphic.InterpolationMode = InterpolationMode.HighQualityBicubic; graphic.SmoothingMode = SmoothingMode.HighQuality;
0
1285
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 quality of the thumbnail. Can someone direct me where to incorporate this code? Thanks. Code to insert: graphic.InterpolationMode = InterpolationMode.HighQualityBicubic; graphic.SmoothingMode = SmoothingMode.HighQuality;
0
8420
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8842
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8516
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
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 we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.