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. 


-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Kevin Cannon
Sent: Sun 4/30/2006 6:37 AM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] XPath Problem
 
Hi,

I'm playing around with Xfactor's XPath implementation but running into
trouble with a basic test. I can parse the xml fine on the first run, but I
want to subsequently parse those results.  Here's the (rough) code:

// This gets a list of the countries
function parseXML(xmlData) {

        countriesList = XPath.selectNodes(xmlData, "/map/country");
        
        handleCountry(countriesList[0]);
}

// I want to find the name of a country

function handleCountry(country) {

        trace(country);         // traces the corect XML out for the country

        countryName = XPath.selectNodes(country, "/country/name");
        trace(countryName);     // shows nothing        

        // If I do this though, I get back the original results
        countryList = XPath.selectNodes(country, "/map/country");
        trace(countryList);     // shows country list
}

It doesn't seem to point to the XML I've grabbed from the first function.
Traces all seem to be fine up to that point, so I'm really at a loss.

Anyone got any ideas?

- Kevin
_______________________________________________
Flashcoders@chattyfig.figleaf.com
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

_______________________________________________
Flashcoders@chattyfig.figleaf.com
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

Reply via email to