Has anone encountered the following error that doesn't allow you to
query child nodes of a particular node?  Here is the sample code.  Sorry
for the wrapping:

-----------------------------------------------------------
import com.xfactorstudio.xml.xpath.*;
_global.XPath = XPath;

// XML
var myStr:String =
"<products><product><flag>0</flag><colors><clr>green</clr></colors><colo
rs><clr>red</clr></colors><name>Item
1</name><price>19.95</price></product><product><flag>1</flag><colors><cl
r>blue</clr><clr>red</clr></colors><name>Plate</name><price>12.95</price
></product><product><colors><clr>silver</clr></colors><flag>0</flag><nam
e>Spoon</name><price>4.95</price></product></products>";
var myXML:XML = new XML(myStr);
trace("myXML: " + myXML);

// Query 1
var result1_array:Array = XPath.selectNodes(myXML,"//product[colors/clr
= 'green']");
trace("\nGreen Results:\t" +  result1_array);
trace("Result Length:\t\t" +  result1_array.length);

// Query 2
var result2_array:Array = XPath.selectNodes(myXML,"//product[colors/clr
= 'red']");
trace("\nRed Results:\t" +  result2_array);
trace("Result Length:\t\t" +  result2_array.length);

Doug Coning 
Software Developer
FORUM Solutions, LLC
 
This e-mail and any attachment(s) are intended for the specified recipient(s) 
only and are legally protected.  If you have received this communication in 
error, please "reply to" sender's e-mail address with notification of the error 
and then destroy this message in all electronic and physical forms.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to