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. XmlListModel Retrive content:encoded data
Forum Updated to NodeBB v4.3 + New Features

XmlListModel Retrive content:encoded data

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 188 Views
  • 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.
  • O Offline
    O Offline
    omerfurkan
    wrote last edited by omerfurkan
    #1

    I am creating an RSS feed with Qt 6.9 QML. The XML data I retrieve contains a content:encoded part, but I am unable to retrieve this section; it returns empty. What is the reason for this, and how can I fix it?

        XmlListModel {
            source: "/rss"
            query: "/rss/channel/item"
    
            XmlListModelRole {name: "newsTitle"; elementName: "title"} // Work
            XmlListModelRole {name: "newsImage"; elementName: "enclosure"; attributeName: "url"} // Work
            XmlListModelRole {name: "newsDetail"; elementName: "description"} // Work
            XmlListModelRole {name: "newsCategory"; elementName: "category" } // Work
            XmlListModelRole {name: "newsDate"; elementName: "pubDate" } // Work
            XmlListModelRole {name: "newsContent"; elementName: "content:encoded"} // Not Work
        }
    
    // XML Area
    <description>
    </description>
    <content:encoded>
    </content:encoded>
    
    JonBJ 1 Reply Last reply
    0
    • O omerfurkan

      I am creating an RSS feed with Qt 6.9 QML. The XML data I retrieve contains a content:encoded part, but I am unable to retrieve this section; it returns empty. What is the reason for this, and how can I fix it?

          XmlListModel {
              source: "/rss"
              query: "/rss/channel/item"
      
              XmlListModelRole {name: "newsTitle"; elementName: "title"} // Work
              XmlListModelRole {name: "newsImage"; elementName: "enclosure"; attributeName: "url"} // Work
              XmlListModelRole {name: "newsDetail"; elementName: "description"} // Work
              XmlListModelRole {name: "newsCategory"; elementName: "category" } // Work
              XmlListModelRole {name: "newsDate"; elementName: "pubDate" } // Work
              XmlListModelRole {name: "newsContent"; elementName: "content:encoded"} // Not Work
          }
      
      // XML Area
      <description>
      </description>
      <content:encoded>
      </content:encoded>
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote last edited by JonB
      #2

      @omerfurkan
      Is content:encoded an encoded element in a content namespace, or is it something you made up? Assuming the former, don't you have to do something like pass the content separately as a namespace from the encoded as an element name in whatever you do, such as reading it? I know nothing about QML, only XML.

      O 1 Reply Last reply
      0
      • JonBJ JonB

        @omerfurkan
        Is content:encoded an encoded element in a content namespace, or is it something you made up? Assuming the former, don't you have to do something like pass the content separately as a namespace from the encoded as an element name in whatever you do, such as reading it? I know nothing about QML, only XML.

        O Offline
        O Offline
        omerfurkan
        wrote last edited by
        #3

        @JonB said in XmlListModel Retrive content:encoded data:

        Is content:encoded an encoded element in a content namespace, or is it something you made up? Assuming the former, don't you have to do something like pass the content separately as a namespace from the encoded as an element name in whatever you do, such as reading it? I know nothing about QML, only XML.

        Yes, content:encoded is a content element. From what I've researched, in Qt 5, we could achieve this with namespaces, but I believe namespaces have been removed in Qt 6.

        1 Reply Last reply
        0

        • Login

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