我没有用qml xmllistmodel做 par车。
<kml xmlns:ns3="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" xmlns:ns2="http://www.w3.org/2005/Atom"
xmlns="http://www.opengis.net/kml/2.2">
<Document>
<description>Available CAR2GO Vehicles</description>
<Style id="car2go">
<IconStyle>
<Icon>
<href>http://www.car2go.com/default/img/backgrounds/Marker_car2go.png
</href>
</Icon>
<hotSpot y="0.0" x="0.0" />
</IconStyle>
</Style>
<Placemark>
<name>UL-C5887</name>
<description>Sudetenweg, 89075 Ulm<br/>Fuel
24<br/>Interior EXCELLENT<br/>Exterior EXCELLENT
</description>
<styleUrl>#car2go</styleUrl>
<ExtendedData>
<Data name="fuel">
<value>24</value>
</Data>
<Data name="interior">
<value>EXCELLENT</value>
</Data>
<Data name="exterior">
<value>EXCELLENT</value>
</Data>
<Data name="vin">
<value>WME4513001K154655</value>
</Data>
</ExtendedData>
<Point>
<coordinates>10.029,48.4362,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
我的法典
XmlListModel {
namespaceDeclarations: "declare namespace ns2= http://www.w3.org/2005/Atom ;declare default element namespace http://www.opengis.net/kml/2.2 "
query: "/kml/Document/Placemark"
XmlRole { name: "plate_number"; query: "name/string()" }
XmlRole { name: "address"; query: "description/string()" }
XmlRole { name: "fuel"; query: "ExtendedData/Data[1]/string()" }
XmlRole { name: "interior"; query: "ExtendedData/Data[2]/string()" }
XmlRole { name: "exterior"; query: "ExtendedData/Data[3]/string()" }
XmlRole { name: "vin"; query: "ExtendedData/Data[4]/string()" }
XmlRole { name: "coordinates"; query: "coordinates/string()" }
}
但是,这确实存在。
Error XPST0003 in file ... syntax error, unexpected NCName, expecting ; QML XmlRole: invalid query: "name/string()" etc.
预先感谢