Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Fetch & Read XML Data into HTML File? >Thread Next - Re: Fetch & Read XML Data into HTML File? Re: Fetch & Read XML Data into HTML File?To: NULL Date: 9/8/2008 11:23:00 AM "Martin Honnen" <mahotrash@y...> wrote in message news:u3S245bEJHA.4104@T...... > Richard In Va. wrote: > >> URL for XML file = http://xoap.weather.com/weather/local/23218?cc=&dayf=7 >> >> Elements / attributes I'm interested in... >> >> <dnam>?</dnam> >> <tm>?</tm> > > With MSXML you can use XPath to select nodes in an XML document so in an > HTA you could use JScript > var doc = new ActiveXObject('Msxml2.DOMDocument.3.0'); > doc.async = false; > if (doc.load('http://xoap.weather.com/weather/local/23218?cc=&dayf=7')) > { > doc.setProperty('SelectionLanguage', 'XPath'); > var locEl = doc.selectSingleNode('/wheather/loc'); > var dnamEl = loc.selectSingleNode('dnam'); > var dnam = dnamEl.text; > var tmEl = loc.selectSingleNode('tm'); > var tm = tmEl.text; > // now you can use the string variables dnam and tm to insert the > // values in your HTML document > } > else > { > //deal with doc.parseError here > } > > -- > > Martin Honnen --- MVP XML > http://JavaScript.FAQTs.com/ Thanks again Martin, Okay, I think I can follow that, but how do I single out the individual days when... <dayf> <day d="0" t="Monday" dt="Sep 8"> <hi>90</hi> <low>70</low> <part p="d"> <t>Mostly Sunny</t> <ppcp>20</ppcp> <hmid>66</hmid> I'll want the "Monday", <hi>, <low>, <t>, <ppcp> and <hmid> for each day #0-6 If you can show me how to get the "Monday" and 1 element within day #0 I'll figure the rest. Your dealing with a learner here, so if you would, better show me an HTML example of how to display the data in my webpage. Thanks again Martin, Richard in VA. ++++++++++++++++ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
