Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Problem using XmlListModel query to parsing rss xml
Forum Updated to NodeBB v4.3 + New Features

Problem using XmlListModel query to parsing rss xml

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xiazhouquan
    wrote on 19 Jun 2011, 04:15 last edited by
    #1

    here is the rss xml :
    @
    -<rss version="2.0">
    -<channel>
    -<item>
    -<description>
    <img src="">or, The Ship Wreck; also A Voyage to Norway; and The Fisherman's Cottage. </p><p>Author: Agnes Strickland </p>
    <p>Language: English </p><p>Published: 1851 </p>
    -</description>
    -</item>
    -</channel>
    -</rss>
    @
    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

    XmlListModel{
    id:feedModel
    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!

    业精于勤荒于嬉,行成于思毁于随

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cmer4
      wrote on 20 Jun 2011, 06:13 last edited by
      #2

      Hi,

      Could you please double check your XML file - it contains some mistyped characters as I see it. Also there is opening <p> which is missing...so please clean it first a bit and then specifiy exactly what do you expect to grab from the xml as pass it over to the role.

      1 Reply Last reply
      0

      1/2

      19 Jun 2011, 04:15

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved