Maybe try using filter and a regexp for the part that you want to be case
insensitive. Something like (very untested):
$(...).find('item').filter(function() { return this.name.match(new
RegExp(search, 'i')); }).each(function() {

});

I don't recall the syntax for accessing an XML attribute from javascript, so
the "this.name" part might be wrong. Maybe you need $(this).attr('name')
instead. Also, you might want to be doing more than just passing the search
into a RegExp, but you get the idea.

Also, maybe reconsider what you're trying to do. Maybe just return your xml
such that it's already been converted to lower case, then just do what you
were doing before except use search.toLowerCase() instead of just search.

Hope it helps.

--Erik



On Mon, Sep 22, 2008 at 12:35 AM, blockedmind <[EMAIL PROTECTED]> wrote:

>
> Nothing?
>
> On Sep 20, 5:22 pm, blockedmind <[EMAIL PROTECTED]> wrote:
> > I am making search in an xml file, but I don't get expected results
> > since jQuery selectors arecase-sensitive. I use something like
> >
> > $(returnedXml).find("item[name*='"+search+"']").each(function(){
> >
> > });
> >
> > How to make it INCASE-SENSITIVE?
>

Reply via email to