Solved

XML Parse format

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

749 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