Fixes bug with NS declaration duplicates

This commit is contained in:
Sergey Toshin
2018-04-07 22:06:53 +03:00
committed by Skylot
parent 1c352cc81b
commit 2e5d73a7e4
@@ -174,7 +174,11 @@ public class BinaryXMLParser extends CommonBinaryParser {
int comment = is.readInt32();
int beginPrefix = is.readInt32();
int beginURI = is.readInt32();
nsMap.computeIfAbsent(getString(beginURI), k -> getString(beginPrefix));
String nsValue = getString(beginPrefix);
if(!nsMap.containsValue(nsValue)) {
nsMap.putIfAbsent(getString(beginURI), nsValue);
}
namespaceDepth++;
}
@@ -190,7 +194,11 @@ public class BinaryXMLParser extends CommonBinaryParser {
int endPrefix = is.readInt32();
int endURI = is.readInt32();
namespaceDepth--;
nsMap.computeIfAbsent(getString(endURI), k -> getString(endPrefix));
String nsValue = getString(endPrefix);
if(!nsMap.containsValue(nsValue)) {
nsMap.putIfAbsent(getString(endURI), nsValue);
}
}
private void parseCData() throws IOException {