That's using Flash's XML object with XPath to grab the node value - sure that works, and is good for nodes with CDATA, but overly complex - wrapping String() around it is easier. I was wondering just about the XPath implementation and why it doesn't return a native string, thanks though.
Jason Merrill | E-Learning Solutions | icfconsulting.com >>-----Original Message----- >>From: [EMAIL PROTECTED] [mailto:flashcoders- >>[EMAIL PROTECTED] On Behalf Of Mike Boutin >>Sent: Tuesday, December 20, 2005 1:43 PM >>To: Flashcoders mailing list >>Subject: Re: [Flashcoders] Out of curiosity, XPath and String Datatype Oddity >> >>Maybe something like this may help? >> >>myText=XMLNode((XPath.selectNodes(myxml,"myNodePath/mynode()")[0])).no de >>Value; >> >> >> >>Mike Boutin >> >> >>Merrill, Jason wrote: >> >>>>>AFAIK, XPath.selectNodes() returns an Array. >>>>> >>>>> >>> >>>How do you use Xpath to return node values then? >>> >>>Jason Merrill | E-Learning Solutions | icfconsulting.com >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>>>>-----Original Message----- >>>>>From: [EMAIL PROTECTED] [mailto:flashcoders- >>>>>[EMAIL PROTECTED] On Behalf Of Johan Lopes >>>>>Sent: Tuesday, December 20, 2005 1:07 PM >>>>>To: Flashcoders mailing list >>>>>Subject: Re: [Flashcoders] Out of curiosity, XPath and String Datatype >>>>> >>>>> >>>Oddity >>> >>> >>>>>Hi Jason, >>>>> >>>>>AFAIK, XPath.selectNodes() returns an Array. >>>>> >>>>><snippet from the docs> >>>>> >>>>> /** >>>>>10 * selectNodes >>>>>11 * >>>>>12 * returns an array of nodes that match the given XPath >>>>>13 * expression using the the XMLNode (context) as the >>>>>14 * starting context for the expression. >>>>>15 * >>>>>16 * This is the description >>>>>17 * @param (XMLNode)context >>>>>18 * @param (String)XPath expression >>>>>19 * @return (Array) matching nodes >>>>>20 */ >>>>>21 static function selectNodes(context,path:String):Array{ >>>>>22 return XPathParser.parseQuery(context,path) >>>>>23 } >>>>>24 >>>>> >>>>></snippet from the docs> >>>>> >>>>>HTH, >>>>> >>>>>/Johan >>>>> >>>>>On 12/20/05, Merrill, Jason <[EMAIL PROTECTED]> wrote: >>>>> >>>>> >>>>>>I'm asking this more out of curiosity than necessity, but the >>>>>> >>>>>> >>>responses >>> >>> >>>>>>to this thread may help be avoid some headaches in the future. >>>>>> >>>>>>Been using xfactorstudio's Xpath classes with great success. >>>>>> >>>>>> >>>However, I >>> >>> >>>>>>have found an odd thing - sometimes I have to cast what I thought >>>>>> >>>>>> >>>was >>> >>> >>>>>>already string, to a String in order for a V2 component to accept >>>>>> >>>>>> >>>the >>> >>> >>>>>>value. For example, >>>>>> >>>>>>**This does not work: >>>>>> >>>>>>var thisVideo:String = XPath.selectNodes("content_xml", >>>>>>"thecontentpath/@videoUrl"); >>>>>>video_mc.mediaPlayer.setMedia(thisVideo);//does not work >>>>>> >>>>>>----Even though no compiler errors and a trace on the var >>>>>> >>>>>> >>>"thisVideo" >>> >>> >>>>>>traces the proper "string" (media/video/Welcome.flv) - or what I >>>>>> >>>>>> >>>thought >>> >>> >>>>>>was a string, the video in the MediaPlayback component does not >>>>>> >>>>>> >>>play.--- >>> >>> >>>>>>**So instead, when casting to String first, this works: >>>>>>var thisVideo:String = String(XPath.selectNodes("content_xml", >>>>>>"thecontentpath/@videoUrl")); >>>>>>video_mc.mediaPlayer.setMedia(thisVideo);.//works >>>>>> >>>>>>Why? What type of object was the Xpath value before I cast it to a >>>>>>string? This makes sense for numbers in an XML file, but for >>>>>> >>>>>> >>>Strings??? >>> >>> >>>>>>The kicker is I can send other XPath values I don't cast to strings >>>>>>first to text fields, textAreas, and they show up fine. So is it >>>>>>something quirky with V2 components as well? >>>>>> >>>>>>Thanks. >>>>>> >>>>>>Jason Merrill | E-Learning Solutions | icfconsulting.com >>>>>> >>>>>> >>>>>> >>>>>>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 >>>>>>Flashcoders@chattyfig.figleaf.com >>>>>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >>>>>> >>>>>> >>>>>> >>>>>_______________________________________________ >>>>>Flashcoders mailing list >>>>>Flashcoders@chattyfig.figleaf.com >>>>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >>>>> >>>>> >>>_______________________________________________ >>>Flashcoders mailing list >>>Flashcoders@chattyfig.figleaf.com >>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >>> >>> >>> >> >>_______________________________________________ >>Flashcoders mailing list >>Flashcoders@chattyfig.figleaf.com >>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders