derekfurman
asked on
XML Parse format
XML
I can parse the data from : TempfNodeData0 = objXML.selectsingleNode("/ dwml/data/ parameters /temperatu re/value[0 ]").text
To : <%response.write TempfNodeData0 %>
But I also need:
WeatherCond0 = objXML.selectsingleNode("/ dwml/data/ parameters /weather/w eather-con ditions/va lue.weathe r-type[0]" ).text
To : <%response.write WeatherCond0 %>
The XML looks like this :
- <weather-conditions>
- <value coverage="chance" intensity="light" weather-type="rain showers" qualifier="none">
<visibility xsi:nil="true" />
</value>
</weather-conditions>
I need to parse the data from weather-type="rain showers"
Im sure this is just a lack of understanding the correct format
Example:
<%Dim objXML,TempfNodeData0,Weat herCond0,
set objXML = CreateObject("MSXML2.FreeT hreadedDOM Document.3 .0")
objXML.async = False
objXML.setProperty "ServerHTTPRequest", true
objXML.Load ("http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLclient.php?lat=48.4212160&lon=-122.3340474&product=glance&begin=2004-01-01t00%3a00%3a00&end=2011-03-25t00%3a00%3a00&maxt=maxt&wx=wx&submit=submit/")
If not objXML.parseError.errorCod e <> 0 then
TempfNodeData0 = objXML.selectsingleNode("/ dwml/data/ parameters /temperatu re/value[0 ]").text
WeatherCond0 = objXML.selectsingleNode("/ dwml/data/ parameters /weather/w eather-con ditions/va lue.weathe r-type[0]" ).text
end if
Set objXML = Nothing %>
<%response.write TempfNodeData0 %>
<br />
<%response.write WeatherCond0 %>
I can parse the data from : TempfNodeData0 = objXML.selectsingleNode("/
To : <%response.write TempfNodeData0 %>
But I also need:
WeatherCond0 = objXML.selectsingleNode("/
To : <%response.write WeatherCond0 %>
The XML looks like this :
- <weather-conditions>
- <value coverage="chance" intensity="light" weather-type="rain showers" qualifier="none">
<visibility xsi:nil="true" />
</value>
</weather-conditions>
I need to parse the data from weather-type="rain showers"
Im sure this is just a lack of understanding the correct format
Example:
<%Dim objXML,TempfNodeData0,Weat
set objXML = CreateObject("MSXML2.FreeT
objXML.async = False
objXML.setProperty "ServerHTTPRequest", true
objXML.Load ("http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLclient.php?lat=48.4212160&lon=-122.3340474&product=glance&begin=2004-01-01t00%3a00%3a00&end=2011-03-25t00%3a00%3a00&maxt=maxt&wx=wx&submit=submit/")
If not objXML.parseError.errorCod
TempfNodeData0 = objXML.selectsingleNode("/
WeatherCond0 = objXML.selectsingleNode("/
end if
Set objXML = Nothing %>
<%response.write TempfNodeData0 %>
<br />
<%response.write WeatherCond0 %>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
pleas have a look at my next ?