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.
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
<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/”
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”
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.