?
Solved

XML Parse format

Posted on 2007-03-25
2
Medium Priority
?
291 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Accepted Solution

by:
B_Dorsey earned 2000 total points
ID: 18789898
try

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

Author Comment

by:derekfurman
ID: 18794071
Thank you that is the solution!

pleas have a look at my next ?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
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.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

800 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