Hi Mike, Many thanks, that was exactly what I was looking for. I didnt have the chance to see the code but I did some test and it seems to be working fine. At least it returns what it is expected. I have in mind to build some user interface to evaluate e4x expression, I'll back to the list as soon as I have something to show.
BTW did Alex post anything regarding this topic in his blog? Cheers, Diego. On Tue, 31 Oct 2006 16:47:11 +1300, Michael Labriola <[EMAIL PROTECTED]> wrote: > > Diego, > > Here is a starting point. There are probably bugs, it is bloated, > and it is not completely tested, however, it is a starting point. > > A final version of this, along with some actual example code, error > handling and other dynamic tools will eventually be available in a > devnet article. > > Used as follows: > > import net.digitalprimates.utils.E4XParser; > var parser:E4XParser; > parser = new E4XParser(); > > var returnXML:XMLList; > //Use parser.evaluate( data:XML, expression:String ); > returnXML = parser.evaluate( myXML, '..item.(@id==2)..price' ); > > If you find a bug, let me know off list. > > BTW, thanks on this and future releases also go to Alex Harui who > started this pet project before I. (Although none of the blame for > the bad code that currently permeates it) > > http://www.digitalprimates.net/src/e4x.zip > > --Mike > > > --- In [email protected], "Diego Guebel" > <[EMAIL PROTECTED]> wrote: >> >> Hi all, >> I'm wondering if there is any method to "apply" an e4x expression > passed >> as a string to an xml. >> For example I have this variable: >> private var sourceXML:XML = <order> >> <book ISBN="0942407296"> >> <title>Baking Extravagant Pastries with > Kumquats</title> >> <author> >> <lastName>Contino</lastName> >> <firstName>Chuck</firstName> >> </author> >> <pageCount>238</pageCount> >> </book> >> <book ISBN="0865436401"> >> <title>Emu Care and Breeding</title> >> <editor> >> <lastName>Case</lastName> >> <firstName>Justin</firstName> >> </editor> >> <pageCount>115</pageCount> >> </book> >> </order> >> >> and a method like this: >> >> private function testExpression(s:String):void >> { >> // somehow, I want to apply that string as e4x expression to > the xml >> result_txt.text = sourceXML.apply(s); >> } >> >> Any clue? >> Thanks in advance. >> Diego. >> > > > > > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com > Yahoo! Groups Links > > > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

