HighTechTalks DotNet Forums  

XML Parsing in CF 2.0

Dotnet Framework (Compact Framework) microsoft.public.dotnet.framework.compactframework


Discuss XML Parsing in CF 2.0 in the Dotnet Framework (Compact Framework) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
rmakerson3@gmail.com
 
Posts: n/a

Default XML Parsing in CF 2.0 - 11-27-2006 , 05:48 PM






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


Reply With Quote
  #2  
Old   
Chris Oswald
 
Posts: n/a

Default Re: XML Parsing in CF 2.0 - 11-28-2006 , 11:54 AM






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.

rmakerson3 (AT) gmail (DOT) com wrote:
Quote:
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


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.