Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-17588

XmlListModel data is truncated to focused element and below

    XMLWordPrintable

Details

    • ddcf9fc80e074c5a9d1ecbbf3c60ca27f250ce98

    Description

      When using XmlListModel to traverse a set of items that iterate in serveral nodes, it's not convenient to be able to collapse multiple levels into one 'table', because XmlListModel seems to truncate data preceding the focused element. E.g. given the following model it's not possible to move back up into the hierarchy to extract attributs from the 'list' element;

      XmlListModel {
          id: rtmModel
          source:  Engine.getTaskList()
          query: "/rsp/tasks/list/taskseries"
          
          // Example Response: <rsp>
          //                   <tasks>
          //                     <list id="987654321">
          //                       <taskseries id="123456789" created="2006-05-07T10:19:54Z" modified="2006-05-07T10:19:54Z"
          //                                  name="Get Bananas" source="api" url="" location_id="">
          //                         <tags/>
          //                         <participants/>
          //                         <notes/>
          //                         <task id="987654321" due="" has_due_time="0" added="2006-05-07T10:19:54Z"
          //                              completed="" deleted="" priority="N" postponed="0" estimate=""/>
          //                         ...
          //                       </taskseries>
          //                       ...
          //                     </list>
          //                     ...
          //                   </tasks>
          
          // The following two does NOT work, but should be possible according to XPath specs
          // XmlRole { name: "list_id"; query:"ancestor::list/@id/string()" }
          // XmlRole { name: "list_id"; query:"../list/@id/string()" }
      
          // Remaining roles work fine
          XmlRole { name: "taskseries_name"; query:"@name/string()" }
          XmlRole { name: "taskseries_id"; query:"@id/string()" }
          XmlRole { name: "task_completed"; query:"task/@completed/string()" }
          XmlRole { name: "task_id"; query:"task/@id/string()" }
          XmlRole { name: "note_title"; query:"notes/note/@title/string()" }
          XmlRole { query:"notes/note/string()"; name: "note_description" }
          XmlRole { query:"participants/contact[1]/@fullname/string()"; name:"participants" }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            smd Jan Arve
            hhartz Henrik Hartz (closed Nokia identity) (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes