# Retrieving XML attribute value

**URL:** <https://forum.kirupa.com/t/retrieving-xml-attribute-value/215399>\
**Category:** flash\
**Created:** [February 7, 2007, 1:44am UTC](https://forum.kirupa.com/t/retrieving-xml-attribute-value/215399 "2007-02-07T01:44:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![solitarycow](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@solitarycow](https://forum.kirupa.com/u/solitarycow)\
**Post date:** [February 7, 2007, 1:44am UTC](https://forum.kirupa.com/t/retrieving-xml-attribute-value/215399/1 "2007-02-07T01:44:30Z")

</div>

Hi folks,  
Realllly quick question. How do I go about retreiving the attribute value in the following XML script. In this case “atl” in the first child?

```auto
<?xml version="1.0" encoding="iso-8859-1"?>
<hotels>
	<prop id="atl">
		<name>Atlantic City</name>
		<lowest_rate>129</lowest_rate>
	</prop>
	<prop id="blv">
		<name>Georgetown</name>
		<lowest_rate>149</lowest_rate>
	</prop>
	<prop id="cac">
		<name>Miami</name>
		<lowest_rate>169</lowest_rate>
	</prop>
	<prop id="las">
		<name>Las Vegas</name>
		<lowest_rate>169</lowest_rate>
	</prop>
</hotels>

```

And here’s my AS:

```auto
var xmlMe:XML = new XML();
xmlMe.ignoreWhite = true;
xmlMe.load("lowest_rate.xml");

xmlMe.onLoad = function(p_success:Boolean){
trace("::CODE IS SUCCESSFUL::");
//Below is a sample XML path, you will need to confirm
//the correct path for your needs.
trace(this.firstChild.attributes.path);
};

```

Obviously, my trace isn’t bringing up the right value…  
Any help would be greatly appreciated!
