diff --git a/lib/OpenLayers/Format/WMSGetFeatureInfo.js b/lib/OpenLayers/Format/WMSGetFeatureInfo.js index 52b1223fc9..10f4b02fd1 100644 --- a/lib/OpenLayers/Format/WMSGetFeatureInfo.js +++ b/lib/OpenLayers/Format/WMSGetFeatureInfo.js @@ -150,10 +150,25 @@ OpenLayers.Format.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Format.XML, { var featureNode = featureNodes[i]; var geom = null; + // attributes can be actual attributes on the FIELDS tag, + // or FIELD children var attributes = {}; - for(var j=0, jlen=featureNode.attributes.length; j 0) { + for(j=0; j function test_read_FeatureInfoResponse(t) { - t.plan(5); + t.plan(7); var parser = new OpenLayers.Format.WMSGetFeatureInfo(); @@ -49,6 +49,25 @@ t.eq(features[1].attributes.STATE_NAME, 'Wyoming', "Attribute STATE_NAME contains the right value"); + text = '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + ''; + + features = parser.read(text); + + t.eq(features.length, 2, + "Parsed 2 features in total"); + + t.eq(features[1].attributes.FID, '31AL0011', + "Attribute FID contains the right value"); + } function test_read_msGMLOutput(t) {