lundi 3 avril 2017

whiteSpace in the xml line I'm trying to retrieve with AS3 code

I've got this AS3 code :

var tomorrowWeather = xml.weatherdata.forecast.tabular.windSpeed name.@mps;

I'm trying to reach the "mps" element in an xml file online :

<time period="1" to="2017-04-04T12:00:00" from="2017-04-04T09:00:00">
<windDirection name="West" code="W" deg="278.2"/>
<windSpeed name="Light air" mps="1.0"/>

Problem : windSpeed name got a space so my AS3 code is throwing an syntax error(1086)

How can I manage this space between "windSpeed" and "name" in order to make my variable tomorrowWeather = mps ?

Aucun commentaire:

Enregistrer un commentaire