diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-01-31 00:33:01 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-01-31 00:33:01 +0100 |
commit | c3e4f0eaacf8ab32ceab32b8f46e8b7d85c71cfb (patch) | |
tree | 7078095423ad0e7c35e2f9a1cf98e48127daa155 /src/de/gultsch/chat/xml | |
parent | 6c5c3ac2decac75ec3208d47912e67c4e1a33548 (diff) |
parser works but some stuff still needs some refactoring
Diffstat (limited to 'src/de/gultsch/chat/xml')
-rw-r--r-- | src/de/gultsch/chat/xml/XmlReader.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/de/gultsch/chat/xml/XmlReader.java b/src/de/gultsch/chat/xml/XmlReader.java index e086c8ae..8963f8d7 100644 --- a/src/de/gultsch/chat/xml/XmlReader.java +++ b/src/de/gultsch/chat/xml/XmlReader.java @@ -50,6 +50,7 @@ public class XmlReader { //Log.d(LOGTAG,"there was a wake lock. releasing it till next event"); wakeLock.release(); //release wake look while waiting on next parser event } + //Log.d(LOGTAG,"waiting for new event..."); while(parser.next() != XmlPullParser.END_DOCUMENT) { //Log.d(LOGTAG,"found new event. acquiring wake lock"); wakeLock.acquire(); @@ -75,17 +76,21 @@ public class XmlReader { public Element readElement(Tag currentTag) throws XmlPullParserException, IOException { Element element = new Element(currentTag.getName()); + //Log.d(LOGTAG,"trying to read element "+element.getName()); element.setAttributes(currentTag.getAttributes()); Tag nextTag = this.readTag(); + //Log.d(LOGTAG,"next Tag is: "+nextTag.toString()); if(nextTag.isNo()) { element.setContent(nextTag.getName()); nextTag = this.readTag(); } + //Log.d(LOGTAG,"reading till the end of "+element.getName()); while(!nextTag.isEnd(element.getName())) { Element child = this.readElement(nextTag); element.addChild(child); nextTag = this.readTag(); } + //Log.d(LOGTAG,"return with element"+element); return element; } } |