summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-05-11 03:47:08 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-05-11 23:46:47 (GMT)
commit0b715811609b86f9332ffd49aea08f4a4b634d21 (patch)
tree6f2ba84547a35337703c5f9233ee8044378a319a
parentef23de2b16f3eaf6621c9407f7d921d55e380982 (diff)
downloadQt-0b715811609b86f9332ffd49aea08f4a4b634d21.zip
Qt-0b715811609b86f9332ffd49aea08f4a4b634d21.tar.gz
Qt-0b715811609b86f9332ffd49aea08f4a4b634d21.tar.bz2
Improve XmlListModel::namespaceDeclarations() docs
Task-number: QTBUG-10522
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index ae3b5d7..b9afa1f 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -479,7 +479,6 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
Here is an example of a model containing news from a Yahoo RSS feed:
\qml
XmlListModel {
- id: feedModel
source: "http://rss.news.yahoo.com/rss/oceania"
query: "/rss/channel/item"
XmlRole { name: "title"; query: "title/string()" }
@@ -652,7 +651,20 @@ void QDeclarativeXmlListModel::setQuery(const QString &query)
/*!
\qmlproperty string XmlListModel::namespaceDeclarations
- A set of declarations for the namespaces used in the query.
+ The namespace declarations to be used in the XPath queries.
+
+ The namespaces should be declared as in XQuery. For example, if a requested document
+ at http://mysite.com/feed.xml uses the namespace "http://www.w3.org/2005/Atom",
+ this can be declared as the default namespace:
+
+ \qml
+ XmlListModel {
+ source: "http://mysite.com/feed.xml"
+ query: "/feed/entry"
+ namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';"
+ XmlRole { name: "title"; query: "title/string()" }
+ }
+ \endqml
*/
QString QDeclarativeXmlListModel::namespaceDeclarations() const
{