Try:

XPath.selectNodes(this,"product/products/text()");

Instead.  What does your XML look like?

For the above to work, it would have to be:

<product>
        <product>
                Hi there.
        </product>
</product>

However, not a good idea to have a child node be the same name as the
parent node (though it's OK in the sense it that won't screw up Xpath).

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com










>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:flashcoders-
>>[EMAIL PROTECTED] On Behalf Of Kent Humphrey
>>Sent: Thursday, February 02, 2006 10:20 AM
>>To: Flashcoders mailing list
>>Subject: [Flashcoders] xpath / xpath4as2 beginners question
>>
>>I'm trying to figure out how to use xfactorstudios xpath4as2 class,
>>but I can't seem to get over the first hurdle! Can anyone tell me why
>>this isn't working?
>>
>>import com.xfactorstudio.xml.xpath.*;
>>
>>myDoc = new XML();
>>myDoc.onLoad = function(){
>>      var products = XPath.selectNodes(this,"/product/products");
>>      trace("Products: "+products);
>>      trace(this);
>>}
>>myDoc.load("../xml/test.xml");
>>
>>The above code is from the xfactostudios site (http://
>>www.xfactorstudio.com/ActionScript/AS2/XPath/) and the xml file I am
>>loading is also from that page. What I have added is the two trace()
>>statements to see if things are working.
>>
>>The first trace doesn't give me anything, but the second shows the
>>whole xml file, so I know that at least the load is working.
>>
>>I have the class files located in Mac HD/Users/Username/Library/
>>Application Support/Macromedia/Flash 8/en/Configuration/Classes/com/
>>xfactorstudio/xml/xpath/ - that's correct isn't it?
>>
>>Any ideas? And does anyone know some good tutorials for this class?
>>
>>Thanks.
>>_______________________________________________
>>Flashcoders mailing list
>>[email protected]
>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
NOTICE:
This message is for the designated recipient only and may contain privileged or 
confidential information. If you have received it in error, please notify the 
sender immediately and delete the original. Any other use of this e-mail by you 
is prohibited.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to