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.