我想提取“坐标”节点的内容使用xmlstarlet这个KML文件。
KML文件使用xmlstarlet本身验证罚款。
我已经缩短到包含一个小的测试文件:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<Placemark>
<name>eurovelo-5 690</name>
<Snippet></Snippet>
<description><![CDATA[ ]]></description>
<styleUrl>#style390</styleUrl>
<LineString>
<tessellate>1</tessellate>
<coordinates>
10.146948,44.790592,97.500000
10.146958,44.790562,97.599998
10.147018,44.790497,97.699997
10.147083,44.790466,97.699997
</coordinates>
</LineString>
</Placemark>
</Document>
</kml>
运行此查询失败,但:
xmlstarlet sel -t -c "//coordinates/text()" test.kml
这似乎是正确解析使用在线路径工具- http://www.qutoric.com/xslt/analyser/xpathtool.html
我失去了一些东西在这里?