Re: [Ubuntu-phone] Multiple nested levels in a QML XmlListModel

2015-04-20 Thread Niklas Wenzel
Ah, ok. Looks like I should have looked at your code. Having only read your email, I thought you wrote your own parser in JavaScript. Sorry for that. ;) Am Mo, 20. Apr, 2015 um 8:53 schrieb Sam Bull : On lun, 2015-04-20 at 18:24 +0200, Niklas Wenzel wrote: There's also the parsing mechanism o

Re: [Ubuntu-phone] Multiple nested levels in a QML XmlListModel

2015-04-20 Thread Sam Bull
On lun, 2015-04-20 at 18:24 +0200, Niklas Wenzel wrote: > There's also the parsing mechanism of XmlHttpRequest. That's probably > more reliable than any self-written parser. ;) Is this not what I did? I used XmlHttpRequest to open the XML document, and then started processing the file using xhr.re

Re: [Ubuntu-phone] Multiple nested levels in a QML XmlListModel

2015-04-20 Thread Niklas Wenzel
There's also the parsing mechanism of XmlHttpRequest. That's probably more reliable than any self-written parser. ;) Am Mo, 20. Apr, 2015 um 5:37 schrieb Sam Bull : On sab, 2015-04-18 at 15:20 +0200, Simon wrote: Is it really *that* hard to parse a multilevel XML file in QML? Feel like a com

Re: [Ubuntu-phone] Multiple nested levels in a QML XmlListModel

2015-04-20 Thread Sam Bull
On sab, 2015-04-18 at 15:20 +0200, Simon wrote: > Is it really *that* hard to parse a multilevel XML file in QML? Feel > like a complete idiot. Complex XML is impossible to parse using the XmlListModel, as I found out when creating my dictionary app. If you're finding your XML is too complex, then

Re: [Ubuntu-phone] Multiple nested levels in a QML XmlListModel

2015-04-19 Thread Niklas Wenzel
Do you have some code snippets for me so that I can have a look at what you are doing? The xml property should indeed return the raw XML data. You can try to add the following to your first XmlListModel to check if its xml property changes during the process: onXmlChanged: console.log(xml)

Re: [Ubuntu-phone] Multiple nested levels in a QML XmlListModel

2015-04-18 Thread Simon
Thank you Niklas. I am playing with your solution but can't get it to work. Calling .xml on an XmlListModel always returns an empty string for me. This means I am passing an empty string as the XML source of modelTwo which, obviously, doesn't work. Is it supposed to return the raw XML data and if

Re: [Ubuntu-phone] Multiple nested levels in a QML XmlListModel

2015-04-16 Thread XiaoGuo Liu
I have seen a similar article at http://stackoverflow.com/questions/19281773/reading-multiple-xml-attributes-with-qml However, it is still tricky to form the tree architecture that xml has in the ListModel in QML. I also has a problem in interpreting my xml data. For example: OK 40 20 7288959

Re: [Ubuntu-phone] Multiple nested levels in a QML XmlListModel

2015-04-16 Thread Niklas Wenzel
Hi Simon, Check out the "xml" property of the XmlListModel. [1] Try something like the following: XmlListModel { id: modelOne ... } XmlListModel { id: modelTwo xml: modelOne.xml } That will make the second model use the content the first model downloaded. ;) Cheers, Niklas [1]

[Ubuntu-phone] Multiple nested levels in a QML XmlListModel

2015-04-15 Thread Simon
Hi everyone, I am learning QML and have a question but ask.ubuntu.com and stackoverflow are not as responsive to QML questions as I hoped, is this the right place to ask for help? I am wondering how to query a second level in an XML file. Currently using an XmlModelList with a ListView but it **d