2012-05-14 64 views
0

我有一個問題讓我感到困惑。如何將數據字符串存儲到數組中

這是問題所在。

<Placemark> 
    <name>Turn left onto Jalan Raden Ajeng Kartini</name> 
<description><![CDATA[go 550&#160;m]]></description> 
<StyleMap> 
<Pair> 
    <key>normal</key> 
    <Style> 
     <IconStyle> 
     <Icon><href>http://maps.gstatic.com/intl/en_ALL/mapfiles/kml/paddle/pause.png</href></Icon> 
     <hotSpot x="0.500000" y="0.000000" xunits="fraction" yunits="fraction" /> 
     </IconStyle> 
     <ListStyle> 
     <ItemIcon><href>http://maps.gstatic.com/intl/en_ALL/mapfiles/kml/paddle/pause-lv.png</href></ItemIcon> 
     </ListStyle> 
    </Style> 
</Pair> 
<Pair> 
    <key>highlight</key> 
    <Style> 
     <IconStyle> 
     <scale>1.300000</scale> 
     <Icon><href>http://maps.gstatic.com/intl/en_ALL/mapfiles/kml/paddle/pause.png</href></Icon> 
     <hotSpot x="0.500000" y="0.000000" xunits="fraction" yunits="fraction" /> 
     </IconStyle> 
     <ListStyle> 
     <ItemIcon><href>http://maps.gstatic.com/intl/en_ALL/mapfiles/kml/paddle/pause-lv.png</href></ItemIcon> 
     </ListStyle> 
    </Style> 
</Pair> 
</StyleMap> 
<Point> 
    <coordinates>106.827140,-6.296370,0</coordinates> 
</Point> 
<LookAt> 
    <longitude>106.827140</longitude> 
    <latitude>-6.296370</latitude> 
    <range>100.000000</range> 
    <tilt>45.000000</tilt> 
    <heading>347.976074</heading> 
</LookAt> 
</Placemark> 

在標籤我們可以看到子標籤<name>...</name>包含了像字符串值「左轉上惹拉登Ajeng卡蒂妮

在我的XML文檔,我發現許多標籤名稱,如這個。我如何將它們保存到一個數組?

+0

參見[這個問題](http://stackoverflow.com/questions/6026916/android-how-to-get-values-in-under-specific -xml標籤) – keyser

回答

相關問題