User Tools

Site Tools


public:t-vien-09-1:lab_1_materials

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
public:t-vien-09-1:lab_1_materials [2009/01/15 09:36] – created hannespublic:t-vien-09-1:lab_1_materials [2024/04/29 13:33] (current) – external edit 127.0.0.1
Line 102: Line 102:
 # We can extract XML elements by name (we get a list, but only take the first match) # We can extract XML elements by name (we get a list, but only take the first match)
 current_weather_element = rssweather_xml.getElementsByTagName("yweather:condition")[0] current_weather_element = rssweather_xml.getElementsByTagName("yweather:condition")[0]
-print "Current temperature is "+ current_weather_element.getAttribute("temp")+" deg."+print "Current temperature is "+ current_weather_element.getAttribute("temp")+" deg. Farenheit" 
 +# Here we got the attribute of an element node, but to get the text of a text node, we can use node.nodeValue
 </code> </code>
  
/var/www/cadia.ru.is/wiki/data/attic/public/t-vien-09-1/lab_1_materials.1232012174.txt.gz · Last modified: 2024/04/29 13:33 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki