XML

  • Thread starter Thread starter Mark Fox
  • Start date Start date
M

Mark Fox

Hello,

I'm new to XML in ASP.NET and have some XML:


<Reason>

<ReasonCategory>Death</ReasonCategory>
<Contacts>
<Contact>
<Name></Name>
<Phone></Phone>

<Address></Address>

<CityStateZip></CityStateZip>

<Relation></Relation>

<IsMember></IsMember>
</Contact>
</Contacts>
<ReasonDetails>

<PlaceOfDeath></PlaceOfDeath>

<CauseOfDeath></CauseOfDeath>

<FuneralLocationName></FuneralLocationName>

<FuneralLocationAddress></FuneralLocationAddress>

<FuneralLocationCity></FuneralLocationCity>

<FuneralLocationState></FuneralLocationState>

<FuneralLocationZip></FuneralLocationZip>

<FuneralLocationPhone></FuneralLocationPhone>

<FuneralDateTime></FuneralDateTime>

<FoodRequirements></FoodRequirements>
<ReasonDetails>
<RequestedServices>
<RequestedService>

<OfferedServiceID></OfferedServiceID>

<OfferedServiceName></OfferedServiceName>

<AssignedTo></AssignedTo>

<FollowUpID></FollowUpID>
</RequestedService>
</RequestedServices>
<FormDetails>

<CompletedBy></CompletedBy>

<CompletedDate></CompletedDate>

<InformationProvider></InformationProvider>
<Notes></Notes>
</FormDetails>
</Reason>

That I'm looking to parse and write. Using XmlTextReader
with a switch(reader.Name) is pretty tedious. Is there a
way to just load the whole string into a tree-like object
where I could do a

foreach(Node Contact in Contacts)

type of thing and just reference nodes by a

string Notes = Node["Notes"].Value;

type of code? Any help would be appreciated! Thanks so
much!
 
This is pretty basic XML. Look into the XMLDocument object. That is what
it is there for.
 
Scott,

The XMLDocument is exactly what I was looking for.
Thanks for pointing me to it!
-----Original Message-----
This is pretty basic XML. Look into the XMLDocument object. That is what
it is there for.


Mark Fox said:
Hello,

I'm new to XML in ASP.NET and have some XML:


<Reason>

<ReasonCategory>Death</ReasonCategory>
<Contacts>
<Contact>
<Name></Name>
<Phone></Phone>

<Address></Address>

<CityStateZip></CityStateZip>

<Relation></Relation>

<IsMember></IsMember>
</Contact>
</Contacts>
<ReasonDetails>

<PlaceOfDeath></PlaceOfDeath>

<CauseOfDeath></CauseOfDeath>

<FuneralLocationName></FuneralLocationName>

<FuneralLocationAddress></FuneralLocationAddress>

<FuneralLocationCity></FuneralLocationCity>

<FuneralLocationState></FuneralLocationState>

<FuneralLocationZip></FuneralLocationZip>

<FuneralLocationPhone></FuneralLocationPhone>

<FuneralDateTime></FuneralDateTime>

<FoodRequirements></FoodRequirements>
<ReasonDetails>
<RequestedServices>
<RequestedService>

<OfferedServiceID></OfferedServiceID>

<OfferedServiceName></OfferedServiceName>

<AssignedTo></AssignedTo>

<FollowUpID></FollowUpID>
</RequestedService>
</RequestedServices>
<FormDetails>

<CompletedBy></CompletedBy>

<CompletedDate></CompletedDate>

<InformationProvider></InformationProvider>
<Notes></Notes>
</FormDetails>
</Reason>

That I'm looking to parse and write. Using XmlTextReader
with a switch(reader.Name) is pretty tedious. Is there a
way to just load the whole string into a tree-like object
where I could do a

foreach(Node Contact in Contacts)

type of thing and just reference nodes by a

string Notes = Node["Notes"].Value;

type of code? Any help would be appreciated! Thanks so
much!


.
 
No problem. HTH

Mark Fox said:
Scott,

The XMLDocument is exactly what I was looking for.
Thanks for pointing me to it!
-----Original Message-----
This is pretty basic XML. Look into the XMLDocument object. That is what
it is there for.


Mark Fox said:
Hello,

I'm new to XML in ASP.NET and have some XML:


<Reason>

<ReasonCategory>Death</ReasonCategory>
<Contacts>
<Contact>
<Name></Name>
<Phone></Phone>

<Address></Address>

<CityStateZip></CityStateZip>

<Relation></Relation>

<IsMember></IsMember>
</Contact>
</Contacts>
<ReasonDetails>

<PlaceOfDeath></PlaceOfDeath>

<CauseOfDeath></CauseOfDeath>

<FuneralLocationName></FuneralLocationName>

<FuneralLocationAddress></FuneralLocationAddress>

<FuneralLocationCity></FuneralLocationCity>

<FuneralLocationState></FuneralLocationState>

<FuneralLocationZip></FuneralLocationZip>

<FuneralLocationPhone></FuneralLocationPhone>

<FuneralDateTime></FuneralDateTime>

<FoodRequirements></FoodRequirements>
<ReasonDetails>
<RequestedServices>
<RequestedService>

<OfferedServiceID></OfferedServiceID>

<OfferedServiceName></OfferedServiceName>

<AssignedTo></AssignedTo>

<FollowUpID></FollowUpID>
</RequestedService>
</RequestedServices>
<FormDetails>

<CompletedBy></CompletedBy>

<CompletedDate></CompletedDate>

<InformationProvider></InformationProvider>
<Notes></Notes>
</FormDetails>
</Reason>

That I'm looking to parse and write. Using XmlTextReader
with a switch(reader.Name) is pretty tedious. Is there a
way to just load the whole string into a tree-like object
where I could do a

foreach(Node Contact in Contacts)

type of thing and just reference nodes by a

string Notes = Node["Notes"].Value;

type of code? Any help would be appreciated! Thanks so
much!


.
 
Back
Top