[SOLVED]QML read web .xml information
-
wrote on 12 Jan 2014, 13:26 last edited by
Hey guys,
I am working on a VLC remote and I am able to send commands to the player via this function:
@function passCommands(command)
{
var http = new XMLHttpRequest()
var url = "http://" + ip + ":" + port + "/requests/status.xml?command=" + command;http.open("POST", url, true); // Send the proper header information along with the request http.setRequestHeader("Authorization", "Basic " + Qt.btoa(username + ":" + password)); http.send();
}@
I am still quite new to QML so I am having issues of writing a function to read the information from http://192.168.2.2:8080/requests/status.xml file, which does have a simple sturcture:
@<root>
<fullscreen>false</fullscreen>
<aspectratio>default</aspectratio>
<audiodelay>0</audiodelay>
<apiversion>3</apiversion>
<currentplid>16</currentplid>
<time>1</time>
<volume>128</volume>
<length>6450</length>
<random>false</random>@Does anyone have any tips or anything of how I would go about extracting information from the status.xml file?
Thank you :)
-
Can you look at XmlListModel ? This will help you. Also look at XmlHTTPRequest example to solve your issue. If you need further help, do let me know.
-
wrote on 13 Jan 2014, 14:56 last edited by
Yep it all works now :) thank you
2/3