diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-05-31 21:28:02 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-05-31 21:28:02 +0200 |
commit | 7b5d5165d18042dcb99570e2b3e66afa011e7546 (patch) | |
tree | e7bf2a3a2e2c2e2a8dc9573c0e676531b8e525e1 /src/main/java/de/pixart | |
parent | df196bf6ff0c6c195ffb16c7fe903ff149c553c4 (diff) |
deal with namespace attributes
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r-- | src/main/java/de/pixart/messenger/xml/XmlReader.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/xml/XmlReader.java b/src/main/java/de/pixart/messenger/xml/XmlReader.java index efd4dcc95..1de61e54c 100644 --- a/src/main/java/de/pixart/messenger/xml/XmlReader.java +++ b/src/main/java/de/pixart/messenger/xml/XmlReader.java @@ -65,11 +65,17 @@ public class XmlReader { wakeLock.acquire(); if (parser.getEventType() == XmlPullParser.START_TAG) { Tag tag = Tag.start(parser.getName()); + final String xmlns = parser.getNamespace(); for (int i = 0; i < parser.getAttributeCount(); ++i) { - tag.setAttribute(parser.getAttributeName(i), - parser.getAttributeValue(i)); + final String prefix = parser.getAttributePrefix(i); + String name; + if (prefix != null && !prefix.isEmpty() && !prefix.equals(xmlns)) { + name = prefix + ":" + parser.getAttributeName(i); + } else { + name = parser.getAttributeName(i); + } + tag.setAttribute(name, parser.getAttributeValue(i)); } - String xmlns = parser.getNamespace(); if (xmlns != null) { tag.setAttribute("xmlns", xmlns); } |