I could be wrong but that (user input validation) should be done prior
to RegExp construction.
Kenneth Kawamoto
http://www.materiaprima.co.uk/
Merrill, Jason wrote:
That was it, it works now, thanks. Funny, I didn't notice that, I had
it in my code before, but somewhere along the line of mess
That was it, it works now, thanks. Funny, I didn't notice that, I had
it in my code before, but somewhere along the line of messing with
things, it just switched back over to .toString() and I hadn't noticed.
Thanks everyone!
One more question if I may - how can I exclude certain things like bla
Why not use "toXMLString()":
trace("result: "+xmlListSearch.toXMLString());
When I add more than one node with "Dark" in the title attribute it
finds it with "toString()".
I've always used "toXMLString()" so I was unaware of this.
-- Keith H --
http://keith-hair.com
Merrill, Jason wrote
So in the following code, why doesn't it find the node containing "The
Dark Knight"? Yet, if I switch out "Dark" in the RegExp argument for
"The", it indeed finds all the nodes that have "The" in it. If I again,
switch out the word, "Violet", then nothing gets returned. If I put
"Of", then it re
learning
ideas and technologies?
Check out our internal GT&O Innovative Learning Blog & subscribe.
>>-Original Message-
>>From: [EMAIL PROTECTED]
>>[mailto:[EMAIL PROTECTED] On Behalf Of Keith
>>Sent: Monday, July 21, 2008 8:19 PM
>>To: Flash Co
Thanks for showing these results.
I'm not missing the "attribute" method that much...and after this I
don't feel any guilt for it. :)
-- Keith H --
http://keith-hair.com
Kenneth Kawamoto wrote:
I just run a quick and dirty test, and I think I can confirm that.
The following test for 10,0
cribe.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Kenneth Kawamoto
Sent: Monday, July 21, 2008 12:52 PM
To: Flash Coders List
Subject: Re: [Flashcoders] E4X filtering strange behaviour
Yes that's that :)
Anyway in your case you know
If I may repeat myself "I don't think you need "g" (Global flag) for
this." :)
The reason is, I quote from the doc, "If the g (global) flag is set for
the regular expression, then the search starts at the index position
specified by the lastIndex property of the regular expression. If the
sea
in the Bank of America Flash Platform Developer Community
>> Are you a Bank of America associate interested in innovative learning
>> ideas and technologies?
>> Check out our internal GT&O Innovative Learning Blog & subscribe.
>>
>>
>>> -Origina
ay, July 21, 2008 3:54 PM
To: 'Flash Coders List'
Subject: RE: [Flashcoders] E4X filtering strange behaviour
Hi Jason,
This works for me:
var testXML:XML =
OK, I'm like 95% there, but there is still some kind of bug - here is
how to reproduce:
var testXML:XML =
;
var re:RegExp = new RegExp("The", "g,i");
var xmlListSearch:XMLList = testXML..*.topic.( re["test"](
attribute("title")));
trace("result: "+xmlListSearc
Learning Blog & subscribe.
>>-Original Message-
>>From: [EMAIL PROTECTED]
>>[mailto:[EMAIL PROTECTED] On Behalf
>>Of Robert Leisle
>>Sent: Monday, July 21, 2008 3:54 PM
>>To: 'Flash Coders List'
>>Sub
>>var re:RegExp = new RegExp(searchInput.text, "g")
Thanks - so it looks like I need the global flag, but how do I also pass
the i (ignore case) flag if the RegExp constructor only takes the two
arguments?
Jason Merrill
Bank of America
Enterprise Technology & Global Risk L&LD
Instructional Te
ch:XMLList = testXML.topics.topic.(re["test"](@title));
trace("result: "+xmlListSearch.toXMLString());
Hth,
Bob
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Merrill,
Jason
Sent: Monday, July 21, 2008 12:27 PM
To: Flash Coders List
OK, so this is almost there, but not quite. If I do as Kenneth
suggested (and this should be able to be reproduced),
var testXML:XML =
ogies?
Check out our internal GT&O Innovative Learning Blog & subscribe.
>>-Original Message-
>>From: [EMAIL PROTECTED]
>>[mailto:[EMAIL PROTECTED] On Behalf
>>Of Kenneth Kawamoto
>>Sent: Monday, July 21, 2008 12:52 PM
>>To: Flash Coders
Yes that's that :)
Anyway in your case you know the incoming XML schema so you shouldn't
use wildcard "*" - I think wildcards have serious performance hits.
i.e. "theXML.topics.topic." should be used rather than "theXML..*."
Kenneth Kawamoto
http://www.materiaprima.co.uk/
Merrill, Jason wrot
t;>[mailto:[EMAIL PROTECTED] On Behalf
>>Of Merrill, Jason
>>Sent: Monday, July 21, 2008 10:08 AM
>>To: Flash Coders List
>>Subject: RE: [Flashcoders] E4X filtering strange behaviour
>>
>>>>>>> Also this is shorter:
>>>>>>>
technologies?
Check out our internal GT&O Innovative Learning Blog & subscribe.
>>-Original Message-
>>From: [EMAIL PROTECTED]
>>[mailto:[EMAIL PROTECTED] On Behalf
>>Of Kenneth Kawamoto
>>Sent: Saturday, July 19, 2008 6:19 AM
>>To: Flash C
Ah, I know where the confusion came from, you said the code was based on
my example, but that was actually Wagner's example, where he put
var test:XML = ...etc.
(it was based on my example, but he used "test" as an instance of the
XML when requoting my original question) The use of "test" as the
The code was based on your example and therefore we know the XML schema,
i.e. we know the node name and they all have the attribute "title".
If we don't know anything about the XML we could do something like:
var xmlListSearch:XMLList = test..*.(re["test"](attribute("*")) ||
re["test"](child("
Thanks. However, I have been told using @title is not good in most
situations because it will return an error if a node doesn't have the
attribute, wheras attribute("title") will not.
>>Also this is shorter:
>>var xmlListSearch:XMLList = test..topic.(re.test(@title));
But you still need to speci
I get the correct node (although I also get Warning 3594). If you are
tracing, you must do trace(xmlListSearch.toXMLString());
Also this is shorter:
var xmlListSearch:XMLList = test..topic.(re.test(@title));
Kenneth Kawamoto
http://www.materiaprima.co.uk/
Wagner Amaral wrote:
I was doing some
23 matches
Mail list logo