0

I have some gml that looks like this:

<gml:featureMember>
    <a:location>ABCD</a:location>
    <a:ElevatedPoint>
        <gml:pos>44.0 1.2</gml:pos>
        <a:elevation uom="FT">23</a:elevation>
    </a:ElevatedPoint>
</gml:featureMember>
<gml:featureMember>
    <a:location>EFJH</a:location>
    <a:ElevatedPoint>
        <gml:pos>33.3 -6.9</gml:pos>
        <a:elevation uom="FT">244</a:elevation>
    </a:ElevatedPoint>
</gml:featureMember>

I want to get the gml:pos based on value of a:location. So for example, I want the position related to location ABCD. I'm guessing using xpath is the way forward but not really sure where to start.

Any help appreciated. Let me know if you need any more information.

UPDATE

This is what I've go so far:

var positions = document.evaluate("/featureMember/location[ABCD]/ElevatedPoint/pos", xml, null, XPathResult.ANY_TYPE, null);
sammy88888888
  • 458
  • 1
  • 5
  • 18

1 Answers1

0

Never used Xpath on gml, but this is what i'd do:

/featureMember/location[desired_value]/ElevatedPoint/pos

keep in mind that this is XML xpath syntax and i have no idea how it has to look for GML, and that this will return ALL positions of nodes with the correct location.

Max Uppenkamp
  • 974
  • 4
  • 16