Mike Boutin wrote:
even in this case the result is undefined

string = XPath.selectNodes(my_xml, "/pathto[1]/xml").nodeValue;

I've just gotten the libraries, and it is exactly as I expected. selectNodes returns an Array of XMLNode-objects. Even the notion of /text() is just to get the node, which has no name, as it is a textnode - but it does not mean, that it will return the text. The function will still return an array of XMLNode-objects. So in order to actually get the text, you need to select the corrent index in the array, and then get the nodeValue from the XMLNode. given:

var nodes:Array = XPath.selectNodes(my_xml, "/pathto[1]/xml/text()");
var textnode:XMLNode = XMLNode(nodes[0]);
var text:String = textnode.nodeValue;

That would be the proper way to do this perfectly and correctly. And rather OOP and nice too :)

--
Morten Barklund - Information Architect - Shockwaved
Gothersgade 49, 4th floor - DK-1123 Copenhagen K, Denmark
Phone: +45 7027 2227 - Fax: +45 3369 1174
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to