Accessing XML data with jQuery?

Tivequeuefs

New Member
Say I have this XML, which repeats itself:\[code\]<sample> <org.postgis.Point> <dimension>2</dimension> <haveMeasure>false</haveMeasure> <type>1</type> <srid>4326</srid> <x>-73.43975830078125</x> <y>42.0513801574707</y> <z>0.0</z> <m>0.0</m> </org.postgis.Point><sample>\[/code\]And am using jQuery to try to get the x and y coordinates out of it. How do I do that?\[code\] $(xml).find('sample').each(function(){ $(this).find('org.postgis.Point').each(function(){ var x = $(this).find('x').text();\[/code\]Is this the right idea? Is there a less verbose way to get inside nested tags?
 
Back
Top