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-XmlRole query problem
Forum Updated to NodeBB v4.3 + New Features

XmlListModel-XmlRole query problem

Scheduled Pinned Locked Moved QML and Qt Quick
qmlxmlxml parsingqt 5.4listviewxml model
1 Posts 1 Posters 1.1k 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.
  • C Offline
    C Offline
    ceyhun
    wrote on last edited by
    #1

    Hi,
    I have big problems for using xmllistmodel. First one is about give source to XmlListModel. I want to give it dynamically. For instance after app start i push a button for triggered the process and using the XmlHttpRequest i get an xml response. But i could't give the source of the XmlListModel.
    Second problem about XmlRole's query. Here is my xml:

    <?xml version="1.0" encoding="UTF-8" ?>
    <wfs:featurecollection xmlns="http://www.opengis.net/wfs" xmlns:wfs="http://www.opengis.net/wfs"
    xmlns:gml="http://www.opengis.net/gml" xmlns:tkgm="http://www.tkgm.gov.tr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemalocation="http://www.tkgm.gov.tr http://10.210.75.110:9091/geoserver/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=TKGM%3Ailler http://www.opengis.net/wfs http://10.210.75.110:9091/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd">
    gml:boundedby
    gml:nullunknown</gml:null>
    </gml:boundedby>
    gml:featuremember
    <tkgm:iller fid="iller.1">
    tkgm:tapukimlikno23</tkgm:tapukimlikno>
    tkgm:adAdana</tkgm:ad>
    tkgm:geom
    <gml:polygon srsname="http://www.opengis.net/gml/srs/epsg.xml#4326">
    gml:outerboundaryis
    gml:linearring
    <gml:coordinates xmlns:gml="http://www.opengis.net/gml" decimal="." cs="," ts=" ">
    </gml:coordinates>
    </gml:linearring>
    </gml:outerboundaryis>
    </gml:polygon>
    </tkgm:geom>
    tkgm:durum3</tkgm:durum>
    </tkgm:iller>
    </gml:featuremember>
    </wfs:featurecollection>


    Here is my XmlListModel

    XmlListModel
    {
        id:xmllistmodel
        query:"/wfs:FeatureCollection/gml:featureMember/TKGM:iller"
    
        XmlRole{ name: "parselno"; query:"TKGM:tapukimlikno/string()" }
    

    }
    Problem is about colons (:). I coulnd't write query in XmlRole. I got error that named 'Invalid Query TKGM:tapukimlikno/string()' when app starts. I research XPath syntax and other things about Xpath and i tried many ways (@, //, [ ], *) but i cannot make it. My purpose is giving roles to XmlListModel and get an response object list then give it ListView to show .

    Sorry about my poor english :)
    Thank you.

    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