English 中文(简体)
QML XmlList Model and car2go xml paring
原标题:QML XmlListModel and car2go xml parsing

我没有用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.

预先感谢

最佳回答

The second namespace declaration is missing a terminating semicolon.

替代

namespaceDeclarations: "declare namespace ns2= http://www.w3.org/2005/Atom ;declare default element namespace  http://www.opengis.net/kml/2.2 "

with

namespaceDeclarations: "declare namespace ns2= http://www.w3.org/2005/Atom ;declare default element namespace  http://www.opengis.net/kml/2.2 ;"

应加以确定。

问题回答

暂无回答




相关问题
Parse players currently in lobby

I m attempting to write a bash script to parse out the following log file and give me a list of CURRENT players in the room (so ignoring players that left, but including players that may have rejoined)...

How to get instance from string in C#?

Is it possible to get the property of a class from string and then set a value? Example: string s = "label1.text"; string value = "new value"; label1.text = value; <--and some code that makes ...

XML DOM parsing br tag

I need to parse a xml string to obtain the xml DOM, the problem I m facing is with the self closing html tag like <br /> giving me the error of Tag mismatch expected </br>. I m aware this ...

Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

Locating specific string and capturing data following it

I built a site a long time ago and now I want to place the data into a database without copying and pasting the 400+ pages that it has grown to so that I can make the site database driven. My site ...

热门标签