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

Best way to use XML data source and reuse code?

I have the following situation for an ASP.NET 2.0 web site:

- Data is in one XML file
- I want to transform the data using an XSLT file before using it
- The data is hierarchical
- The data will change only occasionally but is quite large and needs
to be up to date when it does change
- The data will be used to display information in a standard format on
every page, but will be filtered on different pages

Basically, what I'm looking for are suggestions and discussions on the
best way to:

- Cache the data but update it when necessary
- Create reusable code to display the data
- Filter the data when necessary
- Sort the data without reapplying an XSL template

So far, I've got a DataList control bound to an XmlDataSource which
does everything except sorting, but I can envisage solutions involving
DataSets, user controls etc, and I wanted to see what the best options
were in everyone's opinion...

Thanks!

Apr 27 '06 #1
2 2526
I would create a class that mirrors the structure of the XML file, and can
de-serialize the XML file into an instance of the class, and serialize the
class to an XML file in the same format as the original. Then you load it
one time from the file system, work with the class in memory, and only save
it back when you need to.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Ariana" <ar**********@yahoo.co.uk> wrote in message
news:11*********************@u72g2000cwu.googlegro ups.com...
I have the following situation for an ASP.NET 2.0 web site:

- Data is in one XML file
- I want to transform the data using an XSLT file before using it
- The data is hierarchical
- The data will change only occasionally but is quite large and needs
to be up to date when it does change
- The data will be used to display information in a standard format on
every page, but will be filtered on different pages

Basically, what I'm looking for are suggestions and discussions on the
best way to:

- Cache the data but update it when necessary
- Create reusable code to display the data
- Filter the data when necessary
- Sort the data without reapplying an XSL template

So far, I've got a DataList control bound to an XmlDataSource which
does everything except sorting, but I can envisage solutions involving
DataSets, user controls etc, and I wanted to see what the best options
were in everyone's opinion...

Thanks!

Apr 27 '06 #2
Kevin Spencer wrote:
I would create a class that mirrors the structure of the XML file,
and can de-serialize the XML file into an instance of the class, and


Thanks. I had a sneaking suspicion that that might be the way to go - it
would also be more flexible if I ever get the data in something else than
XML. It just means more work right now... :)
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.854 / Virus Database: 582 - Release Date: 03/02/2005
May 3 '06 #3

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

Similar topics

35
by: Swartz | last post by:
Hi all. I'm working here on a small project of mine. I'm not new to programming, but I'm new to PHP. You have to understand that I'm coming from C++, OOP world, so my code might seems a little...
9
by: cryptic_blade | last post by:
I am working on the design for a new application and want to make the program fully object oriented. I have built and used C++ classes before, but never with a database driven application. Should...
4
by: Thomas Paul Diffenbach | last post by:
Can anyone point me to an open source library of /statically allocated/ data structures? I'm writing some code that would benefit from trees, preferably self balancing, but on an embedded system...
16
by: LP | last post by:
Hi, Every morning a .NET application downloads a file with cumulative data which needs to be appended to SQL Server table. This program needs to identify records that have not been previously...
3
by: Simon | last post by:
Hi all, I'm hoping that some of you clever chaps could offer me some advice on code reuse. You see, whenever I make applications, I typically only find very limited
5
by: apandapion | last post by:
I'm working with csharp and .net for the first time, and I've had a fair amount of luck. I started with the MSDN "Walkthrough : Creating a Distributed Application" tutorial and expanded from...
55
by: Steve | last post by:
I have to develop several large and complex C++ hardware test programs that should work under DOS, most likely with 32-bit DOS extender. Development workstation OS would be Microsoft XP. Quite some...
6
by: Jack | last post by:
I have a set of functions to wrap a library. For example, mylib_init() mylib_func() mylib_exit() or handle = mylib_init() mylib_func(handle)
162
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you...
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,...
0
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
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...
0
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...

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.