RE: [Flashcoders] XPath Problem

2006-04-30 Thread Howard Nager
Any chance you can show an example of what your xml file looks like? I was goign to suggest that you try: countryName = XPath.selectNodes(country, ./name); or countryName = XPath.selectNodes(country, ./country/name); But I can't be sure without looking at the xml structure.

Re: [Flashcoders] XPath Problem

2006-04-30 Thread Kevin Cannon
On Sun, Apr 30, 2006 at 10:39:23AM -0400, Howard Nager wrote: Any chance you can show an example of what your xml file looks like? I was goign to suggest that you try: countryName = XPath.selectNodes(country, ./name); or countryName = XPath.selectNodes(country, ./country/name); But

Re: [Flashcoders] XPath Problem

2006-04-30 Thread Bart Wttewaall
That's because you're searching from the country-node, that's the structure you're searching in. Forget about all its parentnodes, we're talking about a new xml-document here. var countriesList:Array = XPath.selectNodes(xmlData, /map/country); for (var i=0; icountriesList; i++) { var

Re: [Flashcoders] XPath Problem

2006-04-30 Thread Kevin Cannon
Bart, Thanks for the explanation, I understand it a better now. Cheers, - Kevin ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you

Re: [Flashcoders] XPath Problem

2006-04-30 Thread erixtekila
That's because you're searching from the country-node, that's the structure you're searching in. Forget about all its parentnodes, we're talking about a new xml-document here. var countriesList:Array = XPath.selectNodes(xmlData, /map/country); for (var i=0; icountriesList; i++) { var

Re: [Flashcoders] XPath Problem

2006-04-30 Thread erixtekila
OK, I get it. It's definitively a problem of reference. In order to filter an already filtered XMLNode, you've got to clone it before. XMLNode has such a function, cloneNode. So your example should work like this : function parseXML(xmlData) { countriesList =