提交 1356d914 编写于 作者: S Skylot

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

上级 fd2dc14e
......@@ -250,7 +250,13 @@ public class BinaryXMLParser extends CommonBinaryParser {
int styleIndex = is.readInt16();
if ("manifest".equals(currentTag) || writer.getIndent() == 0) {
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册