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

Best way to use/keep XML data from file

phl
Hi,

I have some data in an xml file which I need to use in my web form. The
data in the xml file needs to be shown in maybe a repeater, grid or
data control. I will need to parse the data make sense of it and maybe
place it in a data structure. Once I have a meaningful representation
of this data(the format is not exactly how i want it), I would like to
cache it. This data does not change often. So my questions are:

- Would it be easier to write code to parse xml or transform it?
- Is is efficient to hold this data in a dataset/datatable or some kind
of XML object and keep it in application cache?

thanks

phl

May 3 '06 #1
1 1116
In our applications we usually do the following -

class Utility
{

// You may want to consider strongly typed Generic List if you are using
ASP.Net 2.0
static ArrayList xmlData; //contains objects from XML...

static Utility()
{
//Parse the xml file here and put it into a structure which you can
iterate....
loadAndParseXML();
}
}
The static constructor will be called only once and you can expect xmlData
variable to contain the relavent data when required.

Also object in MyXMLData can expose properties so that you can bind on
repeters, datagrids etc. Since you
can write your own logics for Get methodes and also extra properties if
required, this method has an edge over
dataTable or dataset (Still can be done by adding more columns to tables..
but not all that neat)

HTH

Rajesh CKR
"phl" <ki************@hotmail.com> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
Hi,

I have some data in an xml file which I need to use in my web form. The
data in the xml file needs to be shown in maybe a repeater, grid or
data control. I will need to parse the data make sense of it and maybe
place it in a data structure. Once I have a meaningful representation
of this data(the format is not exactly how i want it), I would like to
cache it. This data does not change often. So my questions are:

- Would it be easier to write code to parse xml or transform it?
- Is is efficient to hold this data in a dataset/datatable or some kind
of XML object and keep it in application cache?

thanks

phl


May 3 '06 #2

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

Similar topics

15
by: Joshua Beall | last post by:
Hi All, What is the best way to use a cookie to remember a logged in user? Would you store the username and password in two separate cookies? Should the password be plain text? Hashed? Not...
2
by: Chris Mullins | last post by:
I'm building a GUI that needs to be able to view a large amount of text arranged in rows. Large being anywhere from a few hundred lines through a few hundred thousand. I need a way to "cap" the max...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
0
by: David Helgason | last post by:
I think those best practices threads are a treat to follow (might even consider archiving some of them in a sort of best-practices faq), so here's one more. In coding an game asset server I want...
5
by: Ryan Liu | last post by:
I have an application need export ane import data of projects. There are about 10 database tables releated to one project. 3 of them each could have up to 100K lines data. I can export all data...
2
by: WB | last post by:
I have an app that will need to store hostorical data (path & filenames) in a combo box (so that the user doesn't have to type in the same data each time the app is restarted). Is it best to keep...
12
by: MrQuan | last post by:
G'day all, I have a requirement to communicate between two or more PCs over the Internet, however I have no idea how to go about this. I'm not talking about a chat programme as such, I want to...
7
by: Gladen Blackshield | last post by:
Hello All! Still very new to PHP and I was wondering about the easiest and simplest way to go about doing something for a project I am working on. I would simply like advice on what I'm asking...
2
yashg
by: yashg | last post by:
I am building a data backup application in C# using Sockets. It has a server component and a client component. The client is going to upload files to the server through TCP sockets. I've got all...
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:
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
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
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,...

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.