# Accessing Specific attribute values anywhere within an XML tree structure AS2?

**URL:** https://forum.kirupa.com/t/accessing-specific-attribute-values-anywhere-within-an-xml-tree-structure-as2/272599
**Category:** flash
**Created:** [October 6, 2008, 10:27pm UTC](https://forum.kirupa.com/t/accessing-specific-attribute-values-anywhere-within-an-xml-tree-structure-as2/272599 "2008-10-06T22:27:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bgosh](https://avatars.discourse-cdn.com/v4/letter/b/e47c2d/32.png) [@bgosh](https://forum.kirupa.com/u/bgosh)
#### Post date: [October 6, 2008, 10:27pm UTC](https://forum.kirupa.com/t/accessing-specific-attribute-values-anywhere-within-an-xml-tree-structure-as2/272599/1 "2008-10-06T22:27:33Z")

</div>

I am loading in an XML document that has multiple nodes and childNodes throughout (the example is posted below). What I am trying to do is locate the value of a specific node attribute within the XML file. I tried using Xpath but could not get it to work.

xml sample  
\<SITE\>  
\<MENU NAME=“ARTS & ENTERTAINMENT”\>   
\<CATEGORY NAME=“Portfolio” LINK=“files/arts/portfolio/portfolio.swf”\>   
\</CATEGORY\>  
\<CATEGORY NAME=“Contact” LINK=“files/arts/contact/contact.swf”\>  
\<SUB NAME=“sub title 1” LINK=“files/arts/contact/sub1/sub1.swf” /\>  
\<SUB NAME=“sub title 2” LINK=“files/arts/contact/sub2/sub2.swf” /\>  
\</CATEGORY\>  
\</MENU\>

\<MENU NAME=“AVIATION”\>   
\<CATEGORY NAME=“Portfolio” LINK=“files/aviation/portfolio/portfolio.swf”\>   
\<SUB NAME=“Airports” LINK=“files/aviation/portfolio/airports/airports.swf” \>  
\<SUB2 NAME=“Terminals” LINK=“files/arts/portfolio/airports/term.swf”/\>   
\</SUB\>  
\<SUB NAME=“Contact” LINK=“files/aviation/portfolio/contact/contact.swf” /\>  
\</CATEGORY\>  
\<CATEGORY NAME=“Services” LINK=“files/aviation/services/services.swf”\>  
\<SUB NAME=“design” LINK=“files/aviation/services/design/design.swf” /\>  
\<SUB NAME=“Interior” LINK=“files/aviation/services/interior/interior.swf” /\>  
\<SUB NAME=“Plans” LINK=“files/aviation/services/plans/plans.swf” /\>   
\</CATEGORY\>  
\</MENU\>  
\</SITE\>

What I want to do is locate a specific node attribute such as the “LINK” attribute that has a specific value and then find that specific node’s “NAME” attribute. But how do I locate such an attribute anywhere within the XML structure no matter how deep it goes?

Thank you for your help.
