|
-
Nov 4th, 2011, 12:42 PM
#1
Thread Starter
New Member
Help with CDATA
I have some data that I need to retrieve from an xml files CDATA as seen in <description> below.
<Placemark>
<name><![CDATA[Statistics]]></name>
<description><![CDATA[Distance: 1.61 km (1.0 mi)
Time: 7:56
Moving Time: 7:53
Average Speed: 12.18 km/h (7.6 mi/h)
Average Moving Speed: 12.27 km/h (7.6 mi/h)
Max Speed: 16.30 km/h (10.1 mi/h)
Min Elevation: -24 m (-80 ft)
Max Elevation: -10 m (-32 ft)
Elevation Gain: 23 m (75 ft)
Max Grade: 0 %
Min Grade: 0 %
]]></description>
<styleUrl>#sh_ylw-pushpin</styleUrl>
<Point>
<coordinates>-82.621966,27.773286</coordinates>
</Point>
</Placemark>
<Placemark>
I need to separate the data into individual strings like this:
Time: 7:56
Moving Time: 7:53
Average Speed: 12.18 km/h (7.6 mi/h)
Average Moving Speed: 12.27 km/h (7.6 mi/h)
Max Speed: 16.30 km/h (10.1 mi/h)
Min Elevation: -24 m (-80 ft)
Max Elevation: -10 m (-32 ft)
Elevation Gain: 23 m (75 ft)
Max Grade: 0 %
Min Grade: 0 %
but when I load it into a textbox with the code below, it is all bunched together like this:
Distance: 1.61 km (1.0 mi)Time: 7:56Moving Time: 7:53Average Speed:12.18 km/h (7.6 mi/h)Average Moving Speed: 12.27 km/h (7.6 mi/h)Max Speed:16.30 km/h (10.1 mi/h)Min Elevation: -24 m (-80 ft)Max Elevation: -10 m (-32 ft)Elevation Gain: 23 m (75 ft)Max Grade: 0 %Min Grade: 0 %
Is there a way to separate the CDATA into separate lines as in the first example? The only thing I could think of was using split somehow?
My Code
DSet.ReadXmlSchema(strPath)
DSet.ReadXml(strPath)
DTable = DSet.Tables!Placemark
Textbox.text = DTable.Rows(0).Item(1)
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|