Results 1 to 2 of 2

Thread: problem using XmlListModel query to parsing rss xml

  1. #1
    Join Date
    Jun 2011
    Posts
    1
    Qt products
    Qt3
    Platforms
    MacOS X

    Exclamation problem using XmlListModel query to parsing rss xml

    here is the rss xml :
    Qt Code:
    1. -<rss version="2.0">
    2. -<channel>
    3. -<item>
    4. -<description>
    5. ">or, The Ship Wreck; also A Voyage to Norway; and The Fisherman<p>Author: Agnes Strickland </p>
    6. <p>Language: English </p><p>Published: 1851 </p>
    7. -</description>
    8. -</item>
    9. -</channel>
    10. -</rss>
    To copy to clipboard, switch view to plain text mode 

    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 :
    Qt Code:
    1. import QtQuick 1.0
    2.  
    3. XmlListModel{
    4. id:feedModel
    5. property string currentFeed: "http://www.manybooks.net/rss/ADV.xml"
    6.  
    7. source: currentFeed
    8. query: "/rss/channel/item"
    9. XmlRole { name: "title"; query: "title/string()" }
    10. XmlRole { name: "pubDate"; query: "pubDate/string()" }
    11. XmlRole { name: "cover"; query: "description/string()" }
    12. }
    To copy to clipboard, switch view to plain text mode 
    How can I get <p> in <description> Thank you very much!

    Plaese forgive my poor English!

    thanks again!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: problem using XmlListModel query to parsing rss xml

    The text you posted is not a valid xml because of the ">or" part.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Problem getting HTML Parsing
    By baluk in forum Newbie
    Replies: 0
    Last Post: 21st July 2010, 11:32
  2. Replies: 3
    Last Post: 6th May 2010, 04:02
  3. html parsing class problem
    By yagabey in forum Qt Programming
    Replies: 4
    Last Post: 22nd December 2008, 18:52
  4. XML parsing problem using SAX2
    By Shawn in forum Qt Programming
    Replies: 4
    Last Post: 14th June 2007, 12:06
  5. problem in xml parsing
    By Shawn in forum Qt Programming
    Replies: 4
    Last Post: 28th May 2007, 12:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.