mirror of
https://codeberg.org/monocles/monocles_chat.git
synced 2025-01-15 22:22:22 +01:00
Fix for namespaced attributes
Since we only store them by prefix right now (boo!) at least keep the prefix definition as well. (cherry picked from commit a770c7d60ab14d03d5569df4fa56d2cfb1e4661f)
This commit is contained in:
parent
5f15e851fa
commit
baa7b50263
1 changed files with 6 additions and 0 deletions
|
@ -73,6 +73,12 @@ public class XmlReader implements Closeable {
|
|||
}
|
||||
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) {
|
||||
tag.setAttribute("xmlns", xmlns);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue