Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Is There Any XML Parser Provided for QML JavaScript.

    QML and Qt Quick
    2
    2
    5266
    Loading More Posts
    • 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.
    • A
      at_pradeep last edited by

      Hi all,

      I am really stuck on this, Some how I need to crack this down.
      Is there any XML Parser Provided for QML+JavaScript. like we have in JavaScript "getElementByTagName".
      I need to parse Different type of XML Data received from the XMLHTTPRequest.

      I tried to parse XML data using childNodes, nodeName and nodeValue but there are multiple combinations of the XML data. There can be N numbers of Child node from where i need to get the nodeValue for particular node name.

      I have done this in JavaScript using getElementByTagName, but now I have to do this in QML+JavaScript.
      So is there any standard XML Parser available for QML+JavaScript.

      @
      var httpReq = new XMLHttpRequest();
      httpReq.open("POST", "http://localhost:port/", true);
      httpReq.onreadystatechange = function()
      {
      if(httpReq.readyState == XMLHttpRequest.DONE)
      {
      if( httpReq.status == 200 )
      {
      var doc = httpReq.responseXML.documentElement;
      /--- I need to parse this XML Data and get the results ---/
      }
      }
      };
      @

      Thanks in advance.

      1 Reply Last reply Reply Quote 0
      • D
        digitalsurgeon last edited by

        May be you need to look at XmlRole and XmlModels

        http://doc.qt.nokia.com/latest/qml-xmlrole.html

        check out this project:
        http://projects.developer.nokia.com/QuickFlickr/browser

        it handles some XML in QML

        1 Reply Last reply Reply Quote 0
        • First post
          Last post