# XML that uses reserved keywords in it's namespace

**URL:** <https://forum.kirupa.com/t/xml-that-uses-reserved-keywords-in-its-namespace/264481>\
**Category:** programming\
**Created:** [June 26, 2008, 2:39pm UTC](https://forum.kirupa.com/t/xml-that-uses-reserved-keywords-in-its-namespace/264481 "2008-06-26T14:39:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![benh](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@benh](https://forum.kirupa.com/u/benh)\
**Post date:** [June 26, 2008, 2:39pm UTC](https://forum.kirupa.com/t/xml-that-uses-reserved-keywords-in-its-namespace/264481/1 "2008-06-26T14:39:33Z")

</div>

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

```auto
  
<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

```auto

raceClass = race.@class;

```

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

---

<div class="post-metadata">

**Author:** ![jwilliam](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jwilliam](https://forum.kirupa.com/u/jwilliam)\
**Post date:** [June 26, 2008, 4:02pm UTC](https://forum.kirupa.com/t/xml-that-uses-reserved-keywords-in-its-namespace/264481/2 "2008-06-26T16:02:31Z")

</div>

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

```auto

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]);

```
