import QtQuick 1.0
Rectangle {
Component {
id: delegate
Text{text: title}
}
ListView {
y:10
id: view
anchors.fill: parent
model: model
delegate: delegate
}
XmlListModel {
id:model
source: "http://www.w3.org/"
query: "/html/head"
namespaceDeclarations: "declare default element namespace 'www.w3.org/1999/xhtml/';"
XmlRole { name: "title"; query: "title/string()" }
}
}
我希望我的模型现在包含一个标题为“万维网联盟 (W3C)”的元素,但没有显示任何内容。model.count 为零,但 model.progress 为 1 我使用了错误的命名空间声明吗?
非常感谢
帕特里克