← Back to team overview

ubuntu-phone team mailing list archive

[qml] XmlListModel

 

Can XmlListModel be used for rather complex XML?

My specific use case is for dictionary data, a document refers to a root
word, which can contain several versions of the word, each with their
own definition and several translations (to different languages).

So, I'd like to be able to do something along the lines of:
Repeater {
        LabelHeader {
                text: /dict/word
                Label {
                        text: /dict/word/def
                }
                Repeater {
                        Label {
                                text: /dict/word/trans
                        }
                }
        }
}

So, it will get each word in the dictionary, display it's definition and
all of it's translations.

If I use an XmlListModel with a query like /dict/word/trans it gets all
the translations for every word in a single list with no grouping
between different words.

An example of one of these files is attached.

Attachment: kat.xml
Description: XML document

Attachment: signature.asc
Description: This is a digitally signed message part