From cbd9a90477be526e741364705927b540abb192d1 Mon Sep 17 00:00:00 2001 From: Bart van den Eijnden Date: Tue, 20 Nov 2012 16:42:06 +0100 Subject: [PATCH] appinfo can be specified multiple times, so use an array instead thanks @ahocevar --- lib/OpenLayers/Format/WFSDescribeFeatureType.js | 5 ++++- tests/Format/WFSDescribeFeatureType.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Format/WFSDescribeFeatureType.js b/lib/OpenLayers/Format/WFSDescribeFeatureType.js index b0bb1b694a..dbd524f50e 100644 --- a/lib/OpenLayers/Format/WFSDescribeFeatureType.js +++ b/lib/OpenLayers/Format/WFSDescribeFeatureType.js @@ -149,7 +149,10 @@ OpenLayers.Format.WFSDescribeFeatureType = OpenLayers.Class( this.readChildNodes(node, obj.annotation); }, "appinfo": function(node, obj) { - obj.appinfo = this.getChildValue(node); + if (!obj.appinfo) { + obj.appinfo = []; + } + obj.appinfo.push(this.getChildValue(node)); }, "documentation": function(node, obj) { if (!obj.documentation) { diff --git a/tests/Format/WFSDescribeFeatureType.html b/tests/Format/WFSDescribeFeatureType.html index 6e9812a766..3821c2dc1b 100644 --- a/tests/Format/WFSDescribeFeatureType.html +++ b/tests/Format/WFSDescribeFeatureType.html @@ -425,7 +425,7 @@ var format = new OpenLayers.Format.WFSDescribeFeatureType(); var res = format.read(text); var property = res.featureTypes[0].properties[0]; - t.eq(property.annotation.appinfo, '{"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"); }