Autor Beitrag
mtin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Mi 02.05.07 20:25 
Hallo, ich versuche hier verzweifelt ein Attribut auszulesen und es will und will nich klappen -.-

xml:
ausblenden XML-Daten
1:
2:
3:
4:
5:
6:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>
<yweather:condition text="Fair" code="33" temp="7" date="Tue, 01 May 2007 10:20 pm CEST" />
</channel>
</rss><!-- p1.weather.dcn.yahoo.com compressed/chunked Tue May  1 13:43:29 PDT 2007 -->
(gekürtzt)


code:
ausblenden Delphi-Quelltext
1:
2:
3:
xmldoc.LoadFromXML(weather);
xmldoc.Active:=true;
value:=xmldoc.DocumentElement.ChildNodes['channel'].ChildNodes['yweather:condition'].GetAttributeNS('temp','');


aber es kommt nur immer sowas wie kann nicht "null" in "string" konvertieren :(

was ist denn da nur los?
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Do 03.05.07 06:32 
Hotfix: ohne das 'yweather:' probieren. Versuch's mal.

_________________
Na denn, dann. Bis dann, denn.