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

which xml access type?

Hi,
I'm developing an ASP.NET web app and i'm retrieving some data from xml
files.

My question is, if an xml file is going to be accessed a page is loaded,
should i:
1. use an in-memory XmlDocument (created each time the page is accessed); or
2. use a forward-only XmlTextReader object (created each time the pages is
accessed).

Thanks very much in advance,

Tim.
Nov 12 '05 #1
2 1536
If the XML file doesn't change frequently, and it's not a HUGE file, you
should cache it programmatically with the Cache property on Page, set a
dependency on the physical file (if it may change at all), and use an
XPathDocument if you need querying capabilities.
If you need OuterXml or InnerXml, or generally, an XmlReader interface to
the results of your queries, which will be XPathIterator and XPathNavigator
objects, you may want to take a look at the Mvp.Xml opensource project
(http://sf.net/projects/mvp-xml). It contains quite a lot utility classes
for working with XML in a performant and convenient way. Here's a list of
what you can find in it:
http://weblogs.asp.net/cazzu/archive...15/132532.aspx

--
Daniel Cazzulino [MVP XML]
Clarius Consulting SA
http://weblogs.asp.net/cazzu
http://aspnet2.com

"Timothy V" <tr****@msn.com> wrote in message
news:uH**************@TK2MSFTNGP11.phx.gbl...
Hi,
I'm developing an ASP.NET web app and i'm retrieving some data from xml
files.

My question is, if an xml file is going to be accessed a page is loaded,
should i:
1. use an in-memory XmlDocument (created each time the page is accessed); or 2. use a forward-only XmlTextReader object (created each time the pages is
accessed).

Thanks very much in advance,

Tim.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 23/05/2004
Nov 12 '05 #2
If the XML file doesn't change frequently, and it's not a HUGE file, you
should cache it programmatically with the Cache property on Page, set a
dependency on the physical file (if it may change at all), and use an
XPathDocument if you need querying capabilities.
If you need OuterXml or InnerXml, or generally, an XmlReader interface to
the results of your queries, which will be XPathIterator and XPathNavigator
objects, you may want to take a look at the Mvp.Xml opensource project
(http://sf.net/projects/mvp-xml). It contains quite a lot utility classes
for working with XML in a performant and convenient way. Here's a list of
what you can find in it:
http://weblogs.asp.net/cazzu/archive...15/132532.aspx

--
Daniel Cazzulino [MVP XML]
Clarius Consulting SA
http://weblogs.asp.net/cazzu
http://aspnet2.com

"Timothy V" <tr****@msn.com> wrote in message
news:uH**************@TK2MSFTNGP11.phx.gbl...
Hi,
I'm developing an ASP.NET web app and i'm retrieving some data from xml
files.

My question is, if an xml file is going to be accessed a page is loaded,
should i:
1. use an in-memory XmlDocument (created each time the page is accessed); or 2. use a forward-only XmlTextReader object (created each time the pages is
accessed).

Thanks very much in advance,

Tim.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 23/05/2004
Nov 12 '05 #3

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

Similar topics

1
by: RWC | last post by:
Hi Folks, I'm looking for a way to determine if the client machine has access installed and if so, what version. The reason I need this is to determine (programatically) if the Access Runtime...
8
by: Marc | last post by:
Hi all, Having never used a database before and immersing myself in reading stuff about databases over the last two days I have come to this conclusion, I still don't know which one I need. I've...
1
by: Dave | last post by:
Hello NG, Regarding access-declarations and member using-declarations as used to change the access level of an inherited base member... Two things need to be considered when determining an...
0
by: MeMyselfNDotnet | last post by:
Hi All, Im facing a problem with the COM+ component, will appreciate if u can provide any kind of guidance. My COM+, references a class, lets call it class A. It uses the properties of Class A,...
2
by: Garrett | last post by:
Need any help in determining which groups have been given security access to a folder. Searched DirectoryServices to no avail... Any Help?
5
by: Oberon | last post by:
I want to create a collection of records which will be permanently available at the application level in an ASP.NET application. How should I go about that? Lets say that the record structure...
1
by: Jamad | last post by:
I want to extract some information in a text file that is not tab, comma and space separated. The format of the text file is actually unknown. The problem now is, i want to extract like three lines...
17
by: The Frog | last post by:
Hello everyone, I am working on an application that can build database objects in MS Access from text files. I suppose you could call it a backup and restore type routine. Accessing the...
1
by: Chris | last post by:
Hi, I'm using the following code DataTable tables = ((OleDbConnection)oleconn).GetOleDbSchemaTable( OleDbSchemaGuid.Tables, new object { null, null, null, "TABLE" }); foreach (DataRow r in...
7
by: eduzea | last post by:
I have some code that compiles with gcc but fails with MS VC 8. I would like to know which one is following the C++ standard. istream& istr = false ? cin : ( * new ifstream("test.txt")) ; ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.