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. [solved] How do I merge two XML documents?

[solved] How do I merge two XML documents?

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 1.4k 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.
  • F Offline
    F Offline
    Faid
    wrote on last edited by
    #1

    I'm developing a public transport app that gets travel data from a web service in an XML format. A request however only returns five items with the data I want to present, so I will have to make multiple requests. Additionally I want to have a "pull and release" functionality to request earlier and later travel data. How do I merge the original XML document from the first request with the documents from the subsequent requests?
    Currently I use XMLHttpRequest and just set the XmlListModel's xml property to the responseText of the XMLHttpRequest object when it finishes its request, but that just replaces the xml.

    Edit: Since XmlListModel is read-only, I solved it by using two models. One regular ListModel for the ListView and one XmlListModel for handling the request XML with XPath. In the XmlListModel's onItemInserted the items are then inserted into the ListModel.

    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