I am building a WinForms app that uses Web Services access to a server for
most of its data input/output, but I also need to persist some of its data
to the local disk (basically as a cache of some of the Web Services data) in
XML format.
Since the size of the XML local store could be rather large, I'd prefer to
have a random access mechanism for reading and writing to it. It seems that
XMLReader /XMLWriter are sequentially fast, but have no facility for random
access. XMLDocument can do random access, but only via a complete in-memory
copy of the data that I hold on disk. Correct?
Is there a truly random access alternative, for reading/writing individual
elements (or branches) of an XML file?
Thanks,
-- Bruce 3 2996
Bruce <co*********@newsgroup.nospam> wrote: I am building a WinForms app that uses Web Services access to a server for most of its data input/output, but I also need to persist some of its data to the local disk (basically as a cache of some of the Web Services data) in XML format.
Since the size of the XML local store could be rather large, I'd prefer to have a random access mechanism for reading and writing to it. It seems that XMLReader /XMLWriter are sequentially fast, but have no facility for random access. XMLDocument can do random access, but only via a complete in-memory copy of the data that I hold on disk. Correct?
Yes.
Is there a truly random access alternative, for reading/writing individual elements (or branches) of an XML file?
No. You'd need to keep some kind of index of where each element
started, then seek to that location to read it. Unfortunately, with
buffering etc, keeping that index isn't terribly easy.
Have you considered transforming your data into something less
freeform, like a fixed length record format?
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jon ,
Thanks for the answers.
Yes, I may have to consider a non_XML, fixed-length alternative. But first,
I'll probably try using the XMLDocument approach and see how "costly" it is
to read/write the entire file on each access.
Thanks,
Bruce
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om... Bruce <co*********@newsgroup.nospam> wrote: I am building a WinForms app that uses Web Services access to a server for most of its data input/output, but I also need to persist some of its data to the local disk (basically as a cache of some of the Web Services data) in XML format.
Since the size of the XML local store could be rather large, I'd prefer to have a random access mechanism for reading and writing to it. It seems that XMLReader /XMLWriter are sequentially fast, but have no facility for random access. XMLDocument can do random access, but only via a complete in-memory copy of the data that I hold on disk. Correct?
Yes.
Is there a truly random access alternative, for reading/writing individual elements (or branches) of an XML file?
No. You'd need to keep some kind of index of where each element started, then seek to that location to read it. Unfortunately, with buffering etc, keeping that index isn't terribly easy.
Have you considered transforming your data into something less freeform, like a fixed length record format?
-- Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet If replying to the group, please do not mail me too
Hi Bruce,
Did Jon's suggestion help you?
If you still have any concern, please feel free to post here.
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Keith Griffiths |
last post by:
I'm trying to do a search under a set criteria followed by a selection of
random entries meeting this criteria. But I don't seem to be able to
achieve this.
The idea being to search on say...
|
by: Dr John Stockton |
last post by:
Q1 :
Given an array such as might have been generated by
var A =
is there a highly effective way of reducing it to - i.e.
removing the undefineds and shifting the rest down?
...
|
by: jprunier |
last post by:
Hi
I isolated this code which gives me odd results and I am not sure to
understand why. Basically I declared "positions" as a map that I am using to
store pairs of integers. The key used for the...
|
by: vsgdp |
last post by:
From what I learned, if you want to do random element insertions and
deletions you should use a list. But, with std::vector, if the order of the
elements does not matter, couldn't you efficiently...
|
by: Phil Sherman |
last post by:
What is the relationship between the snapshot elements:
Log pages written
Number write log IOs
Number partial page log IOs
There doesn't appear to be any information in my PDF System monitor...
|
by: jar13861 |
last post by:
I'm confused on how to write a random array that will only generate 9
different numbers from 1-9. Here is what I have, but its only writing
one number....
holder = new Array ( 9 );
var flag =...
|
by: porterboy76 |
last post by:
If you only use a 32 bit seed for a random number generator,
does that mean you can only ever produce a maximum of
2^32 (approx 4 billion) different sequences?
What about the Mersenne Twister,...
|
by: Tuxedo |
last post by:
I'd like to reorganize the third, fourth, fifth and sixth, as well as any
elements thereafter in an array in random order:
var a = new...
|
by: caca |
last post by:
Hello,
This is a question for the best method (in terms of performance
only) to choose a random element from a list among those that satisfy
a certain property.
This is the setting: I need to...
|
by: Peter Olcott |
last post by:
So far the only way that I found to do this was by making a
single global instance of the container class and providing
access to the contained class, through this single global
instance. Are...
|
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$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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,...
| |