我有以下 xml 文件
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Placemark>
<name>Simple placemark</name>
<description>Attached to the ground. Intelligently places itself at the
height of the underlying terrain.</description>
<Point>
<coordinates>-122.0822035425683,37.42228990140251,0</coordinates>
</Point>
</Placemark>
</kml>
</resources>
如何读取标签之间的数字而不是属性???
<coordinates> -122.0822035425683,37.42228990140251,0</coordinates>
我在处理程序中有这个
XMLDataColleted info = new XMLDataColleted();
@Override
public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException {
// TODO Auto-generated method stub
if (localName.equals("coordinates")){
double X = /// need help here how to get the number ;
double Y = // here also ?? ;
info.setx(X) ;
info.sety(Y) ;
}
else if ( localName.equals("description")){
String s = // the discreption // need help here;
info.setDis(s) ;
}