gonen
07-29-2012, 01:57 AM
Hi
I have a very long string like this:
<?xml version="1.0" encoding="UTF-8"?>
<DirectionsResponse>
<status>OK</status>
<route>
<summary>?A16?</summary>
<leg>
<step>
<travel_mode>DRIVING</travel_mode>
<start_location>
<lat>48.8583500</lat>
<lng>2.3532800</lng>
</start_location>
<end_location>
<lat>48.8598600</lat>
<lng>2.3543300</lng>
</end_location>
<polyline>
<points>useiH_sjMcCuAgBgAaAs@</points>
</polyline>
<duration>
<value>27</value>
<text>1 דקה</text>
</duration>
<distance>
<value>184</value>
<text>0.2 ק"מ</text>
</distance>
</step>
<step>
<travel_mode>DRIVING</travel_mode>
<start_location>
<lat>48.8598600</lat>
<lng>2.3543300</lng>
</start_location>
<end_location>
<lat>48.8603100</lat>
<lng>2.3530200</lng>
</end_location>
<polyline>
<points>c}eiHqyjMw@vCa@lB</points>
</polyline>
<duration>
I need to extract only the numbers which are wrapped with <lat>48.8598600</lat>
or
<lng>2.3530200</lng>
so that at the end of the process I will have a new string with pairs of numbers as:
48.8598600,2.3543300
48.8603100,2.3530200
.
.
.
I need advise on the most efficient method to do it
Thank you !!
I have a very long string like this:
<?xml version="1.0" encoding="UTF-8"?>
<DirectionsResponse>
<status>OK</status>
<route>
<summary>?A16?</summary>
<leg>
<step>
<travel_mode>DRIVING</travel_mode>
<start_location>
<lat>48.8583500</lat>
<lng>2.3532800</lng>
</start_location>
<end_location>
<lat>48.8598600</lat>
<lng>2.3543300</lng>
</end_location>
<polyline>
<points>useiH_sjMcCuAgBgAaAs@</points>
</polyline>
<duration>
<value>27</value>
<text>1 דקה</text>
</duration>
<distance>
<value>184</value>
<text>0.2 ק"מ</text>
</distance>
</step>
<step>
<travel_mode>DRIVING</travel_mode>
<start_location>
<lat>48.8598600</lat>
<lng>2.3543300</lng>
</start_location>
<end_location>
<lat>48.8603100</lat>
<lng>2.3530200</lng>
</end_location>
<polyline>
<points>c}eiHqyjMw@vCa@lB</points>
</polyline>
<duration>
I need to extract only the numbers which are wrapped with <lat>48.8598600</lat>
or
<lng>2.3530200</lng>
so that at the end of the process I will have a new string with pairs of numbers as:
48.8598600,2.3543300
48.8603100,2.3530200
.
.
.
I need advise on the most efficient method to do it
Thank you !!