D
Dale Atkin
I've spent the last couple of days digging through MSDN help, and googling
various pages, trying to understand exactly how VB.NET deals with XML. I've
made some progress, but I feel like I'm missing something fundamental. Can
any one point me in the direction of some *good* tutorials that might be
helpful? Everything I've found so far is either way too simple, or seems to
assume that I know things that I don't, so I get hung up on the details.
For reference, basically what I'm trying to do is read and write some fairly
basic XML files (of my own creation) to disk. I've written some routines
already to do this, but I'd prefer to use the built in XML handling
functions, as they are probably a lot more robust than what ever I might
code up in an afternoon (I can already think of a few things a user could do
that will break my code, and I don't feel like fixing them, as I'm sure
there are a dozen other things which I've not thought of yet).
The XML files look something like the below. Basically, they are 'maps' of
an image file. Each slide can contain multiple draw objects (<do>). Each
draw object contains a list of attributes.
<slide>
<name>Name of slide</name>
<longdesc>Description of slide</longdesc>
<do>
<name>Feature name</name>
<id>Feature ID</id>
<type>1</type>
<coords>
1125,1021; 1370,946; 2019,885; 2189,899; ;
</coords>
</do>
<do>
<name>Feature Name 2</name>
<id>ID 2</id>
<type>1</type>
<coords>
2960,1548; 3042,1386; 3165,1247; 3342,1108;
</coords>
</do>
</slide>
Ideally, what I'd like to be able to do, is read in the file, and easily
access the data. I'm able to access the data now, using the 'immediate'
window, but the pattern just isn't logical to me.
Really what I'd like to be able to do, is say something like
Slidename = XML.slide.name
Slidedesc = XML.slide.longdesc
draw0.name = XML.slide.do(0).name
etc.
But I seem to be getting bogged down trying to understand how VB sees XML.
Obviously the above is 'ideal world' stuff, I'm fine access the data in some
other way, provided it makes sense to me. Right now, I feel like I'm trying
to fit a square peg in to a round hole. (Oh, I should mention, I'm free for
the moment to modify the XML format as much as I please, if a modification
would make things more understandable.)
various pages, trying to understand exactly how VB.NET deals with XML. I've
made some progress, but I feel like I'm missing something fundamental. Can
any one point me in the direction of some *good* tutorials that might be
helpful? Everything I've found so far is either way too simple, or seems to
assume that I know things that I don't, so I get hung up on the details.
For reference, basically what I'm trying to do is read and write some fairly
basic XML files (of my own creation) to disk. I've written some routines
already to do this, but I'd prefer to use the built in XML handling
functions, as they are probably a lot more robust than what ever I might
code up in an afternoon (I can already think of a few things a user could do
that will break my code, and I don't feel like fixing them, as I'm sure
there are a dozen other things which I've not thought of yet).
The XML files look something like the below. Basically, they are 'maps' of
an image file. Each slide can contain multiple draw objects (<do>). Each
draw object contains a list of attributes.
<slide>
<name>Name of slide</name>
<longdesc>Description of slide</longdesc>
<do>
<name>Feature name</name>
<id>Feature ID</id>
<type>1</type>
<coords>
1125,1021; 1370,946; 2019,885; 2189,899; ;
</coords>
</do>
<do>
<name>Feature Name 2</name>
<id>ID 2</id>
<type>1</type>
<coords>
2960,1548; 3042,1386; 3165,1247; 3342,1108;
</coords>
</do>
</slide>
Ideally, what I'd like to be able to do, is read in the file, and easily
access the data. I'm able to access the data now, using the 'immediate'
window, but the pattern just isn't logical to me.
Really what I'd like to be able to do, is say something like
Slidename = XML.slide.name
Slidedesc = XML.slide.longdesc
draw0.name = XML.slide.do(0).name
etc.
But I seem to be getting bogged down trying to understand how VB sees XML.
Obviously the above is 'ideal world' stuff, I'm fine access the data in some
other way, provided it makes sense to me. Right now, I feel like I'm trying
to fit a square peg in to a round hole. (Oh, I should mention, I'm free for
the moment to modify the XML format as much as I please, if a modification
would make things more understandable.)