View Full Version : problem using XmlListModel query to parsing rss xml

19th June 2011, 05:20
here is the rss xml :

-<rss version="2.0">
">or, The Ship Wreck; also A Voyage to Norway; and The Fisherman<p>Author: Agnes Strickland </p>
<p>Language: English </p><p>Published: 1851 </p>

now I want to get the content of <p>

but in the XmlListModel{},the query role is “/rss/channel/item”,I can not using /rss/channel/item/description to get <p>

here is my code :

import QtQuick 1.0

property string currentFeed: "http://www.manybooks.net/rss/ADV.xml"

source: currentFeed
query: "/rss/channel/item"
XmlRole { name: "title"; query: "title/string()" }
XmlRole { name: "pubDate"; query: "pubDate/string()" }
XmlRole { name: "cover"; query: "description/string()" }

How can I get <p> in <description> Thank you very much!

Plaese forgive my poor English!

thanks again!

19th June 2011, 09:22
The text you posted is not a valid xml because of the ">or" part.