I've followed the currency converter "Hello World" tutorial, as far as I can see exactly how it should. Yet when I try and run it via QMLScene I get a Syntax Error on line 45.

Line 45 is:

XmlListModel {
    id: ratesFetcher
    source: "http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"
    namespaceDeclarations: "declare namespace gesmes='http://www.gesmes.org/xml/2002-08-01';"
                       +"declare default element namespace 'http://www.ecb.int/vocabulary/2002-08-01/eurofxref';"
    query: "/gesmes:Envelope/Cube/Cube/Cube"

    onStatusChanged: {
        if (status === XmlListModel.Ready) {
            for (var i = 0; i < count; i++)
                currencies.append({"currency": get(i).currency, "rate": parseFloat(get(i).rate)})

    XmlRole { name: "currency"; query: "@currency/string()" }
    XmlRole { name: "rate"; query: "@rate/string()" }


Any ideas what I've messed up here? This is the link for complete code.


Everything should be inside the Rectangle { } block. See http://paste.ubuntu.com/1540065/ for a working example.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.