xml question

D

DaveP

Hello all...
I have a large xml file that holds column definitions and text file data
offsets for the columns...
my question is....the best way to work with the xml

use the xml class as is or load the node values into a class defined for
that xml

thanks
Dave
 
M

Marc Gravell

Depends on a: what you need to achieve, and b: your local definition
of "large".

If it is for ad-hoc querying, then XmlDocument may suffice, but this
tends to be memory-hungry, so not good for multi-megabyte (or larger)
xml. If the file is huge, your best option may be to scan via an
XmlReader. Classes are a reasonable option, especially if you can get
them to line up (read/write) automatically via XmlSerializer. If you
just need to proceess the contents in some way, then perhaps a
transform (xslt) is in order. Lots of options.

But really, the big question is: what do you need to do with the xml
;-p

Marc
 
S

sloan

M

Marc Gravell

3. (not yet stated)
http://home.jondavis.net:880/blog/post/XML-to-C-Code-Generation.aspx

I get an http error on the link - however, I'm going to take a guess
that it is similar to typing (at a VS command prompt)
xsd my.xml
xsd my.xsd /classes /edb

The first command inspects an existing xml document to generate an xsd
schema (defaulting to {inputfile}.xsd); the second command outputs C#
(by default) classes to represent the data, including binding support
[the "edb"].

Very handy ;-p

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top