2
Hello, I would like to know how I parse a reply in xml that I get from my web service..
In this case, I am doing on Android, and wanted to transform the values and names that display in xml, in variables to be applied a graph with the same..
The WS' answer 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..
try this https://github.com/stanfy/gson-xml
– rsicarelli
I don’t understand how it works. You could explain it to me?
– Renan Serrão Nogueira
@Ricardogiaviti would know to tell me?
– Renan Serrão Nogueira