XML Parsing in CF 2.0

R

rmakerson3

When I am reading in a section of XML code for example:

<cl>
<cp Name="Bob" Version="1.02" LastUpdate="01/02/2006">
</cl>

Is it possible to read (name, version, lastupdate) dynamically so that
if they change to (userName, userVersion, updated) that I will still be
able to gracefully handle parsing this code.

Thanks,

Rich
 
C

Chris Oswald

It seems to me that you should have some standards for your XML. You
shouldn't be changing attribute names, element names, etc. It's hard
to parse an XML file with no standards.

Here is a way to dynamically read attributes once you are at the
element that has the attributes.

While reader.MoveToNextAttribute()
attributeValue = reader.Value
End While

Hope this is what you were looking for.
 

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

Top