read XML from Website
criss87
Junior Member
Dear all!
I need to read an XML file from a website, Someone know how to read the file thru code ?
http://www.meteowebcam.it/rss/Monfalcone.xml
Once I will have the file in the string event, I will parse the file myself.
Many thanks for the help,
Cris
I need to read an XML file from a website, Someone know how to read the file thru code ?
http://www.meteowebcam.it/rss/Monfalcone.xml
Once I will have the file in the string event, I will parse the file myself.
Many thanks for the help,
Cris
Comments
-
All you can do is download it and parse it manually through code that you write. You can't use he VAR_TO_XML or XML_TO_VAR functions since they only work on a specific format created by the functions to work with structures.
-
There is a whole thread addressing how to get the content in your string event: http://www.amxforums.com/showthread.php?t=4406
-
Solved !
Work as a charm!
Now I just need to parse all the incoming data....
Many thanks,
Cristiano
button_event[tp,1]
{
push:
{
ip_client_open (dvHTML.Port,'www.meteowebcam.it',80,IP_TCP)
}
}
data_event [dvHTML]
{
online:
{
clear_buffer cWeatherBuf
send_string dvHTML,"'GET /rss/Monfalcone.xml HTTP/1.0',13,10"
send_string dvHTML,"'Host: www.meteowebcam.it',13,10"
send_string dvHTML,",13,10"
}
string:
{
// parsing data here soon.....
}
} -
What I have done is iterate through the buffer by breaking out chunks with the > character. If the source is reasonably consistent, you can then test for a tag by looking for what follows the < in that chunk, and detecting a closing tag by looking for a / . Data itself would have no < in front of it.
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums
