Solved

XML Parse format

Posted on 2007-03-25
2
282 Views
Last Modified: 2013-11-19
XML

I can parse the data from : TempfNodeData0 = objXML.selectsingleNode("/dwml/data/parameters/temperature/value[0]").text

To : <%response.write TempfNodeData0 %>

But I also need:
WeatherCond0 = objXML.selectsingleNode("/dwml/data/parameters/weather/weather-conditions/value.weather-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,WeatherCond0,
set objXML = CreateObject("MSXML2.FreeThreadedDOMDocument.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.errorCode <> 0 then
    TempfNodeData0 = objXML.selectsingleNode("/dwml/data/parameters/temperature/value[0]").text
      WeatherCond0 = objXML.selectsingleNode("/dwml/data/parameters/weather/weather-conditions/value.weather-type[0]").text

end if
Set objXML = Nothing %>


<%response.write TempfNodeData0 %>
<br />
<%response.write WeatherCond0 %>
0
Comment
Question by:derekfurman
2 Comments
 
LVL 14

Accepted Solution

by:
B_Dorsey earned 500 total points
Comment Utility
try

WeatherCond0 = objXML.selectsingleNode("/dwml/data/parameters/weather/weather-conditions/value[0]").getattribute("weather-type")
0
 

Author Comment

by:derekfurman
Comment Utility
Thank you that is the solution!

pleas have a look at my next ?
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now