documentation is also an array, and lang is optional thanks @ahocevar for the catch
This commit is contained in:
@@ -156,11 +156,13 @@ OpenLayers.Format.WFSDescribeFeatureType = OpenLayers.Class(
|
|||||||
},
|
},
|
||||||
"documentation": function(node, obj) {
|
"documentation": function(node, obj) {
|
||||||
if (!obj.documentation) {
|
if (!obj.documentation) {
|
||||||
obj.documentation = {};
|
obj.documentation = [];
|
||||||
}
|
}
|
||||||
var lang = node.getAttribute("xml:lang");
|
|
||||||
var value = this.getChildValue(node);
|
var value = this.getChildValue(node);
|
||||||
obj.documentation[lang] = value.replace(this.regExes.trimSpace, "");
|
obj.documentation.push({
|
||||||
|
lang: node.getAttribute("xml:lang"),
|
||||||
|
textContent: value.replace(this.regExes.trimSpace, "")
|
||||||
|
});
|
||||||
},
|
},
|
||||||
"simpleType": function(node, obj) {
|
"simpleType": function(node, obj) {
|
||||||
this.readChildNodes(node, obj);
|
this.readChildNodes(node, obj);
|
||||||
|
|||||||
@@ -426,7 +426,7 @@
|
|||||||
var res = format.read(text);
|
var res = format.read(text);
|
||||||
var property = res.featureTypes[0].properties[0];
|
var property = res.featureTypes[0].properties[0];
|
||||||
t.eq(property.annotation.appinfo[0], '{"title":{"en":"Population"}}', "appinfo read correctly");
|
t.eq(property.annotation.appinfo[0], '{"title":{"en":"Population"}}', "appinfo read correctly");
|
||||||
t.eq(property.annotation.documentation["en"], "Number of persons living in the state", "documentation read correctly");
|
t.eq(property.annotation.documentation[0], {lang: "en", textContent: 'Number of persons living in the state'}, "documentation read correctly");
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user