<?xml version='1.0' encoding='UTF-8' standalone='no' ?>
<GTSResponse command="dbget" result="success">
<Record table="Device" partial="true">
<Field name="accountID" primaryKey="true"><![CDATA[UsRentcar]]></Field>
<Field name="deviceID" primaryKey="true"><![CDATA[85412452145214]]></Field>
<Field name="lastOdometerKM">12222.0442925558</Field>
<Field name="description"><![CDATA[Toyota Land Cruser]]></Field>
</Record>
<Record table="Device" partial="true">
<Field name="accountID" primaryKey="true"><![CDATA[UsRentcar]]></Field>
<Field name="deviceID" primaryKey="true"><![CDATA[843254752364]]></Field>
<Field name="lastOdometerKM">4348.48814289997</Field>
<Field name="description"><![CDATA[Chevrolet white]]></Field>
</Record>
I have another Response show above with various records. How can I put together two field values in each record. For example :
String [] ListDevice_&_ListDescripcion = { 85412452145214 , Toyota Land Cruser ; 843254752364, Chevrolet white ;....} ;
How can I do it? Here is the result that I have . Please help!
name="accountID" UsRentcar
name="deviceID" 85412452145214 ; name="lastOdometerKM" 14214.0020055 ; name="description" Toyota Land Cruser ; name="accountID" UsRentcar ; name="deviceID" 843254752364; name="lastOdometerKM" 4348.488142847
name="description" Chevrolet white –
You can use JAXB for this:
Create the class that represent the XML:
And use like this:
Note, you can use JAXB to map your XML to a class with XPATH, with the annotation
@XMLPath
, the annotation is part of MOXY.