[GIS] How to use XML data retrieved from WMS GetFeatureInfo

geoservergetfeatureinfoopenlayers-2wms

I use WMS layer in my app and could successfully retrieved Feature Info by click like so: http://openlayers.org/dev/examples/getfeatureinfo-control.html

My question is: Is there any way to export the retrieved data in separate variables? So that I can organize the popup instead id this table. I see that its an XML file but still can't find a way to handle it.

Best Answer

I think you can set

format: new OpenLayers.Format.GML(), // Used to parse the feature info response

infoFormat: 'application/vnd.ogc.gml', // Used to require the WMS server to provide GML format

When you set up your getfeatureinfo control. This should provide the information in a JavaScript variable you can interact with (event.features).