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
Solved

XML Parse format

Posted on 2007-03-25
2
287 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
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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
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…

790 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