Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
Is it this tutorial ? developer.ubuntu.com/resources/app-developer-cookbook/mobile/… If yes, it is not an "Hello World!" but a currency converter application. –  air-dex Jan 16 '13 at 17:45
add comment

1 Answer 1

up vote 4 down vote accepted

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

share|improve this answer
    
Awesome, thank you! –  James Jan 17 '13 at 20:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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