In our project we do a GetFeature request to a WFS service. This service returns some GML. To parse this GML, we are playing with the GML parser of OpenLayers. This is working as long the GML isn't 'complex'. It isn't returning everything.

This is how a GML object looks like:

  <mag:keywords gml:id="TopografischElement_Trefwoord.fid--255d1722_146cd32a493_b9c">
      <mag:keywordtopolink gml:id="1">
         <mag:typology1>Road network</mag:typology1>

This the code we use to parse it:

var content = _this.format.read(data);

and _this.format is:

this.format = new OpenLayers.Format.GML();

So when looping through "content", each object has a data property. When looking that property, we can find the keywordid and keyword (in this example 1 and 'Vlees'). The problem is, I need the data below that, I need the mag:topografischelementid. How can I make it parse that data too, and not only the first 2 fields?

  • Your GML is not a complex feature – nmtoken May 27 '18 at 7:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.