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; i<countriesList; i++) {
var countryName:XMLNode = XPath.selectSingleNode(countriesList[i], "name");
trace(countryName);
}
// -- this should give the same results since xmlData is the source
var countryNames:Array = XPath.selectNodes(xmlData, "/country/name");
trace(countryNames);
2006/4/30, Kevin Cannon <[EMAIL PROTECTED]>:
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 I can't be sure without looking at the xml structure.
Hey,
Here's the XML:
http://www.conquerclub.com/maps/Indochina.xml
Your first solution works fine, though I admit I'm at a bit of a loss as to
why. :)
Thnaks!
- Kevin
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com