aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/web/client')
-rw-r--r--src/org/traccar/web/client/model/StateReader.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/org/traccar/web/client/model/StateReader.java b/src/org/traccar/web/client/model/StateReader.java
index 667f474b..10ed9809 100644
--- a/src/org/traccar/web/client/model/StateReader.java
+++ b/src/org/traccar/web/client/model/StateReader.java
@@ -5,7 +5,10 @@ import java.util.List;
import org.traccar.web.client.ApplicationContext;
import org.traccar.web.shared.model.Position;
-import org.traccar.web.shared.model.XmlParser;
+
+import com.google.gwt.xml.client.Node;
+import com.google.gwt.xml.client.NodeList;
+import com.google.gwt.xml.client.XMLParser;
public class StateReader {
@@ -31,8 +34,13 @@ public class StateReader {
String other = position.getOther();
if (other != null) {
- for (String key : XmlParser.enumerateElements(other)) {
- state.add(new StateItem(key, XmlParser.getElement(other, key)));
+ try {
+ NodeList nodes = XMLParser.parse(other).getFirstChild().getChildNodes();
+ for (int i = 0; i < nodes.getLength(); i++) {
+ Node node = nodes.item(i);
+ state.add(new StateItem(node.getNodeName(), node.getFirstChild().getNodeValue()));
+ }
+ } catch (Exception error) {
}
}