# Xpath question : output+textfields show cat. name from xml

**URL:** <https://forum.kirupa.com/t/xpath-question-output-textfields-show-cat-name-from-xml/180538>\
**Category:** flash\
**Created:** [March 1, 2006, 11:44am UTC](https://forum.kirupa.com/t/xpath-question-output-textfields-show-cat-name-from-xml/180538 "2006-03-01T11:44:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tristessa](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@tristessa](https://forum.kirupa.com/u/tristessa)\
**Post date:** [March 1, 2006, 11:44am UTC](https://forum.kirupa.com/t/xpath-question-output-textfields-show-cat-name-from-xml/180538/1 "2006-03-01T11:44:50Z")

</div>

hello all,  
**if it doesn’t belong here, plz move**

fiddling around with Xpath sure is fun,  
yet i come to a problem i can’t seem to find the answer to.

```auto

var thePath_str:String = "/nutrition/food/name";
        var titleNode:String = XPathAPI.selectSingleNode(this.firstChild, thePath_str);
        knop.btntxt.text = titleNode.toString();
        trace (titleNode.toString())

```

it works but the output give me this

```auto

<name>Avocado Dip</name>

```

how do i force it to show only Avocado Dip ?

the odd thing is : when i simple use the path to a text field fe.  
“/nutrition/food/name/”

```auto

var nameselect = XPathAPI.selectSingleNode(this.firstChild, "/nutrition/food/name/");
         knop.btntxt.text = nameselect;
         trace (nameselect)
 

```

it outputs aswell Avocado Dip

but when i leave the “/” in the nameselect variable like this  
so the path is “/nutrition/food/name”

```auto

var nameselect = XPathAPI.selectSingleNode(this.firstChild, "/nutrition/food/name");

```

i don’t understand this so much

as anyone have a nice pointer?

thnx in advance.
