diff --git a/lib/OpenLayers/Format/WFSDescribeFeatureType.js b/lib/OpenLayers/Format/WFSDescribeFeatureType.js index a946da060c..9823aef232 100644 --- a/lib/OpenLayers/Format/WFSDescribeFeatureType.js +++ b/lib/OpenLayers/Format/WFSDescribeFeatureType.js @@ -17,6 +17,14 @@ */ OpenLayers.Format.WFSDescribeFeatureType = OpenLayers.Class( OpenLayers.Format.XML, { + + /** + * Property: regExes + * Compiled regular expressions for manipulating strings. + */ + regExes: { + trimSpace: (/^\s*|\s*$/g) + }, /** * Property: namespaces @@ -52,15 +60,16 @@ OpenLayers.Format.WFSDescribeFeatureType = OpenLayers.Class( complexTypes: complexTypes, customTypes: customTypes }; + var i, len; this.readChildNodes(node, schema); var attributes = node.attributes; var attr, name; - for(var i=0, len=attributes.length; i' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' {"title":{"en":"Population"}}' + + ' Number of persons living in the state' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ''; + var format = new OpenLayers.Format.WFSDescribeFeatureType(); + var res = format.read(text); + var property = res.featureTypes[0].properties[0]; + t.eq(property.annotation.appinfo[0], '{"title":{"en":"Population"}}', "appinfo read correctly"); + t.eq(property.annotation.documentation[0], {lang: "en", textContent: 'Number of persons living in the state'}, "documentation read correctly"); + } +