Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
XML Node Parsing.
#1
Gone round and round and cannot get QM to parse what I need in an XML file.

http://forecast.weather.gov/MapClick.ph ... igitalDWML

Been having troubles getting data like:
<weather-conditions xsi:nil="true"/>
<weather-conditions>
;;;;<value weather-type="thunderstorms" coverage="definitely"/>
;;;;<value additive="and" weather-type="rain" coverage="definitely"/>
<weather-conditions>
;;;;<value weather-type="rain" coverage="slight chance"/>
<weather-conditions xsi:nil="true"/>
<weather-conditions xsi:nil="true"/>
<weather-conditions xsi:nil="true"/>
#2
Macro Macro1424
Code:
Copy      Help
out

IntGetFile "http://forecast.weather.gov/MapClick.php?lat=41.34083&lon=-89.09083&FcstType=digitalDWML" _s
;_s.getmacro("weather_xml")

IXml x=CreateXml
x.FromString(_s)

ARRAY(IXmlNode) a
x.Path("dwml/data/parameters/weather/weather-conditions" a)

int i
for i 0 a.len
,out "---------------"
,IXmlNode n=a[i].FirstChild
,rep
,,if(!n) break
,,out "weather-type=%s;  coverage=%s" n.AttributeValue("weather-type") n.AttributeValue("coverage")
,,n=n.Next
#3
Perfect.

This example will be useful for so many other functions I'm working on. Thank you so much for taking the time.

Thanks


Forum Jump:


Users browsing this thread: 1 Guest(s)