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);