XML that uses reserved keywords in it's namespace

I have a very naughty bit of XML that uses the word “class” in it’s namespace e.g.

  
<Race trifecta="No" id="195159" date="20080624" time="1745+0100" raceType="Flat" trackType="Turf" handicap="No" class="5" showcase="No">

How can I reference it?

Flash just gives me a compilation error “1084: Syntax error: expecting identifier before class.” when I try it like this


raceClass = race.@class;

Help! (& please don’t say “Change the XML” - I can’t!)

There’s probably a more elegant way of doing this, but this would work in a pinch:


var xml:XML = new XML('<Race trifecta="No" id="195159" date="20080624" time="1745+0100" raceType="Flat" trackType="Turf" handicap="No" class="5" showcase="No">blah</Race>');

var m:Array = new Array();
m = xml.toXMLString().match(/(class=")([^"]+)(")/);

trace(m[2]);