Merge pull request #12936 from ejn/bugfix/gml-multiple-element-parsing
Bugfix for GML parsing with multiple property elements with XML attributes
This commit is contained in:
@@ -319,6 +319,15 @@ class GMLBase extends XMLFeature {
|
||||
}
|
||||
}
|
||||
|
||||
const len = n.attributes.length;
|
||||
if (len > 0) {
|
||||
value = {_content_: value};
|
||||
for (let i = 0; i < len; i++) {
|
||||
const attName = n.attributes[i].name;
|
||||
value[attName] = n.attributes[i].value;
|
||||
}
|
||||
}
|
||||
|
||||
if (values[localName]) {
|
||||
if (!(values[localName] instanceof Array)) {
|
||||
values[localName] = [values[localName]];
|
||||
@@ -327,15 +336,6 @@ class GMLBase extends XMLFeature {
|
||||
} else {
|
||||
values[localName] = value;
|
||||
}
|
||||
|
||||
const len = n.attributes.length;
|
||||
if (len > 0) {
|
||||
values[localName] = {_content_: values[localName]};
|
||||
for (let i = 0; i < len; i++) {
|
||||
const attName = n.attributes[i].name;
|
||||
values[localName][attName] = n.attributes[i].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!asFeature) {
|
||||
return values;
|
||||
|
||||
Reference in New Issue
Block a user