Commit 1356d914 authored by Skylot's avatar Skylot

res: don't add colon for empty namespace (#231)

parent fd2dc14e
...@@ -250,7 +250,13 @@ public class BinaryXMLParser extends CommonBinaryParser { ...@@ -250,7 +250,13 @@ public class BinaryXMLParser extends CommonBinaryParser {
int styleIndex = is.readInt16(); int styleIndex = is.readInt16();
if ("manifest".equals(currentTag) || writer.getIndent() == 0) { if ("manifest".equals(currentTag) || writer.getIndent() == 0) {
for (Map.Entry<String, String> entry : nsMap.entrySet()) { for (Map.Entry<String, String> entry : nsMap.entrySet()) {
writer.add(" xmlns:" + entry.getValue() + "=\"").add(entry.getKey()).add("\""); String nsValue = entry.getValue();
writer.add(" xmlns");
if (nsValue != null && !nsValue.trim().isEmpty()) {
writer.add(':');
writer.add(nsValue);
}
writer.add("=\"").add(entry.getKey()).add("\"");
} }
} }
boolean attrNewLine = attributeCount != 1 && ATTR_NEW_LINE; boolean attrNewLine = attributeCount != 1 && ATTR_NEW_LINE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment