Hello, I would like to know how I parse an xml response that I receive from my web service ..
In case, I'm doing in Android, and wanted to transform the values and names that display in xml, into variables to be applied a graph with them ..
WS's response would be this:
<NewDataSet>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="GWDataTable" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="GWDataTable">
<xs:complexType>
<xs:sequence>
<xs:element name="CODFORMAPG" type="xs:string" minOccurs="0" />
<xs:element name="DESCRICAO" type="xs:string" minOccurs="0" />
<xs:element name="VALOR" type="xs:decimal" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<GWDataTable>
<VALOR>462.73</VALOR>
</GWDataTable> <GWDataTable>
<CODFORMAPG>1 </CODFORMAPG>
<DESCRICAO>DINHEIRO</DESCRICAO>
<VALOR>38502.39</VALOR>
</GWDataTable> <GWDataTable>
<CODFORMAPG>2 </CODFORMAPG>
<DESCRICAO>CHEQUE</DESCRICAO>
<VALOR>3765.63</VALOR>
</GWDataTable> <GWDataTable>
<CODFORMAPG>3 </CODFORMAPG>
<DESCRICAO>CARTOES</DESCRICAO>
<VALOR>13043.70</VALOR>
</GWDataTable> <GWDataTable>
<CODFORMAPG>5 </CODFORMAPG>
<DESCRICAO>TICKETS</DESCRICAO>
<VALOR>6.50</VALOR>
</GWDataTable> <GWDataTable>
<CODFORMAPG>6 </CODFORMAPG>
<DESCRICAO>NOTA PROMISSORIA</DESCRICAO>
<VALOR>56.24</VALOR>
</GWDataTable> <GWDataTable>
<CODFORMAPG>9 </CODFORMAPG>
<DESCRICAO>TEF</DESCRICAO>
<VALOR>27.47</VALOR>
</GWDataTable>
</NewDataSet>
I would like to filter all descriptions and their respective values and store them in variables to be reused ..