[Qt-qml] What's wrong with our XmlListModel?

Daker Fernandes dakerfp at gmail.com
Tue Jul 27 21:22:27 CEST 2010


Ivan,

Looks Like you're trying to read a data inside namespace without saying
you're using it.

Note that all the elements in the Xml is inside a namespace:
...
<app xmlns="http://www.orange.co.uk/ns/app/1">
...

The xmlns says that all the iternal tagas are from
http://www.orange.co.uk/ns/app/1. This a mechanism to avoid
http://www.orange.co.uk/ns/app/1:tagName or nsalias:tagName notations on xml
files.

To fix that declare that you will use a default namespace on your queries:

XmlListModel {
   ...
   namespaceDeclarations: "declare default element namespace'
http://www.orange.co.uk/ns/app/1' "
   ...
}

The same problem occurs with xhtml pages where all the html tags are inside
the "www.w3.org/1999/*xhtml*/" namespace.
Now the queries must find the correct tags. Note that rss feeds has no
namespaces decalarations, and it works without them.

I hope it works.

Daker Fernandes Pinheiro (dfp)
Graduando em CC, turma 2007.2
CIn - UFPE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100727/c6ac0470/attachment.html 


More information about the Qt-qml mailing list