i have to parse it and display it in a asp.net webpage
The output should look like this

XML
<results id="10157" objectType="ROS" systemName="Constitutional" comments="" systemStatus="" patientPartyId="158641" providerPartyId="145150" patientEncounterId="17137" updatedBy="C144964.U685" updatedDate="2012-04-28T10:13:40" urn="ROS-Constitutional-PatientRosSystemsType-10157" createdDate="" createdBy="" activeFlag="true">
<symptoms id="10194" systemId="10157" symptomName="Fatigue" updatedBy="C144964.U685" updatedDate="2012-04-28T10:13:19" urn="ROS-Constitutional-Fatigue-PatientSymptomType-10194" createdDate="" createdBy="" activeFlag="true">
<symptomAttributes id="31393" parentId="10194" className="ObjectAttributeTypeImpl" parentClassName="PatientSymptomType" name="Status" value="C" updatedBy="C144964.U685" updatedDate="2012-04-28T10:13:40" createdBy="" createdDate="" urn="cos-ts-CompanyType-144964-ObjectAttributeType-31393" activeFlag="true"/>
<symptomAttributes id="31394" parentId="10194" className="ObjectAttributeTypeImpl" parentClassName="PatientSymptomType" name="Comment" value="test123" updatedBy="C144964.U685" updatedDate="2012-04-28T10:13:40" createdBy="" createdDate="" urn="cos-ts-CompanyType-144964-ObjectAttributeType-31394" activeFlag="true"/>
</symptoms>
<symptoms id="10195" systemId="10157" symptomName="Fever" updatedBy="C144964.U685" updatedDate="2012-04-28T10:13:19" urn="ROS-Constitutional-Fever-PatientSymptomType-10195" createdDate="" createdBy="" activeFlag="true">
<symptomAttributes id="31395" parentId="10195" className="ObjectAttributeTypeImpl" parentClassName="PatientSymptomType" name="Status" value="C" updatedBy="C144964.U685" updatedDate="2012-04-28T10:13:40" createdBy="" createdDate="" urn="cos-ts-CompanyType-144964-ObjectAttributeType-31395" activeFlag="true"/>
<symptomAttributes id="31396" parentId="10195" className="ObjectAttributeTypeImpl" parentClassName="PatientSymptomType" name="Comment" value="testing" updatedBy="C144964.U685" updatedDate="2012-04-28T10:13:40" createdBy="" createdDate="" urn="cos-ts-CompanyType-144964-ObjectAttributeType-31396" activeFlag="true"/>
</symptoms>
</results>
<results>................</results>
<results>................</results>
........ so on
This is the xml i got from server.
i have to parse this and store it in a collection, i’m not getting any idea how to store it in a collection or something. Because there would be multiple results tags and each result tag has its own values and sub tags
Normally i parse the response and store it in a List<Dictionary<,>> if XML is two level. But here that approach will not work.
I have to store it in one variable(List or something) and only some attributes of the elements i have to store. like in results =>(id,sytemName,comments) in symptoms =>(id,symptomName) and in symptomAttributes => (name,value)…
thanks in advance…
I would recommend:
Defining a struct (“record”) for each “symptom”
Putting your symptoms in a “List”
I’m not sure what a “ROS” or “Constitutional” mean, but I suspect your “symptoms” list might be associated with a “patient”. And that you should also have a “struct” for patient records, and a “List” (containing the “symptoms” sublist).