我必须解析它并将其显示在asp.net网页中
输出应如下所示

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这是我从服务器上得到的xml。我必须解析它并将其存储在集合中,我不知道如何将其存储在集合中或其他什么地方。因为会有多个results标签,并且每个result标签都有自己的值和子标签
通常,如果XML是两级的,我会解析响应并将其存储在List<Dictionary<,>>中。但在这里,这种方法是行不通的。
我必须将其存储在一个变量(List或其他变量)中,并且只需存储elements的一些属性。就像results =>(id,sytemName,comments)中的symptoms =>(id,symptomName)和symptomAttributes => (name,value)...
先谢谢你...
发布于 2012-05-01 12:48:40
我会推荐:
在“"symptom"
https://stackoverflow.com/questions/10393624
复制相似问题