Better handling of namespaced attributes
Don't store in the data model using the prefix -- the prefix is meaningless. Store by URI and then generate prefixes when serializing. (cherry picked from commit caf119b5b63bbc61976731c1cd4795d00e6851c9)
This commit is contained in:
parent
7012aa1702
commit
1b9165ec98
1 changed files with 0 additions and 6 deletions
|
@ -73,12 +73,6 @@ public class XmlReader implements Closeable {
|
||||||
}
|
}
|
||||||
tag.setAttribute(name,parser.getAttributeValue(i));
|
tag.setAttribute(name,parser.getAttributeValue(i));
|
||||||
}
|
}
|
||||||
int nsStart = parser.getNamespaceCount(parser.getDepth()-1);
|
|
||||||
int nsEnd = parser.getNamespaceCount(parser.getDepth());
|
|
||||||
for (int i = nsStart; i < nsEnd; i++) {
|
|
||||||
final var prefix = parser.getNamespacePrefix(i);
|
|
||||||
tag.setAttribute("xmlns" + (prefix == null ? "" : ":" + prefix), parser.getNamespaceUri(i));
|
|
||||||
}
|
|
||||||
if (xmlns != null) {
|
if (xmlns != null) {
|
||||||
tag.setAttribute("xmlns", xmlns);
|
tag.setAttribute("xmlns", xmlns);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue