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
QtWS25 Last Chance

XMLListModel

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 1.7k 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.
  • C Offline
    C Offline
    coolneo
    wrote on last edited by
    #1

    Hello all ,

    i have following xml :

    @<Journeys>
        <Journey>
            <SequenceNo>0</SequenceNo>
            <DepDateTime>2012-07-08T16:50:00</DepDateTime>
            <ArrDateTime>2012-07-08T17:16:00</ArrDateTime>
            <DepWalkDist>0</DepWalkDist>
            <ArrWalkDist>0</ArrWalkDist>
            <NoOfChanges>1</NoOfChanges>
            <Guaranteed>false</Guaranteed>
            <CO2factor>10</CO2factor>
            <NoOfZones>5</NoOfZones>
            <PriceZoneList>12000240,12000241,12000242,12000243,12000250</PriceZoneList>
            <FareType>Normaltaxa</FareType>
            <Prices>...</Prices>
            <JourneyKey>...</JourneyKey>
            <RouteLinks>
                <RouteLink>...</RouteLink>
                <RouteLink>...</RouteLink>
            </RouteLinks>
            <RouteLinks>
                <RouteLink>...</RouteLink>
                <RouteLink>...</RouteLink>
            </RouteLinks>
            <Distance>19960</Distance>
            <CO2value>0.002259</CO2value>
        </Journey>
        <Journey>...</Journey>
        <Journey>...</Journey>
        <Journey>...</Journey>
        <Journey>...</Journey>
    </Journeys>@
    

    can anybody help me to understand how i can parse RoutLinks using XMLListModel.

    I mean what should be the query and XPath statement, also in my model i need tags of journey like Sequenceno, NoofChanges etc.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      leon.anavi
      wrote on last edited by
      #2

      You can check " XmlListModel Element official documentation":http://qt-project.org/doc/qt-4.8/qml-xmllistmodel.html as well as examples like "this":http://www.developer.nokia.com/Community/Wiki/Filtering_XmlListModel_data.

      http://anavi.org/

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        QtRoS
        wrote on last edited by
        #3

        I think will be better to extend QAbstractItemModel and use it as model. In my opinion, JS in QML must do a little and such complex parsing must be performed in C++.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          coolneo
          wrote on last edited by
          #4

          Hello All,

          Thanks for the reply. But i have already used XMLListModel at lots of places !! so i know the simplest use of it.

          I am not a XPath Expert, so i want to understand can i get an array of the RouteLinks tag ?? along with other tags in the xml shown.

          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