Page 1 of 1

bug in evaluateXPathAsString?

Posted: 27 Feb 2013 16:10
by syndromtr
hi, i started a new flow using yahoo weather api with evaluateXPathAsString. here's my flow:

trigger: none
action: http request: http://weather.yahooapis.com/forecastrss?w=2343733&u=c GET , variable, variable name = wea
action: script : var=evaluateXPathAsString(wea, "//yweather:condition/@text");
condition: debug dialog

when i execute this flow manually, wea variable gets all the xml text from web. but var variable is empty in debug dialog..
i checked this "//yweather:condition/@text" Xpath in online xpath tester websites and result is ok. (text="Partly Cloudy" result from xpath)

is this a bug or something is wrong on this flow, typo etc?
regards..

Re: bug in evaluateXPathAsString?

Posted: 27 Feb 2013 17:31
by Martin
Hi,

Namespaces are currently not well supported, you probably have to remove the namespace before you process the XML.
wea=replace(wea, "yweather:", "");
temp=evaluateXPathAsString(wea, "//condition/@temp");
text=evaluateXPathAsString(wea, "//condition/@text");

The namespaces should work as expected in the next update.

Regards
Martin