So does this means that for your example, the data should also have been saved in lowercase in the database? Otherwise there won't be any positive comparison result.

Secondly: My xpath string is formed on runtime...selecting only those nodes for whcih the user has given some value in the submission form e.g.

xpath = "//person[FirstName='John' and City='London']";
where FirstName and city are nodes of XML file.
How can I incorporate the translate function idea in this case?

Will be thankful for your help.


From: Robin Schoeninger <[EMAIL PROTECTED]>
Reply-To: xindice-users@xml.apache.org
To: "'xindice-users@xml.apache.org'" <xindice-users@xml.apache.org>
Subject: RE: xpath query - ignore case sensitive
Date: Tue, 07 May 2002 09:45:56 -0700

Xpath is not case sensitive - you have to use the translate function. It is
a kludgy fix, but it is the only one. It translates your search term to
lower case letters and the node to lower case letters, then it compares.
Have fun.

example:
//dataset[contains(translate(title,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijk
lmnopqrstuvwxyz'),
translate('soil','ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'))
]

Hope this helps,

Robin Schoeninger




Robin T. Schoeninger Center For Environmental Studies Arizona State University 480-727-7290 [EMAIL PROTECTED]





-----Original Message-----
From: White Shadow [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 07, 2002 8:52 AM
To: xindice-users@xml.apache.org
Subject: Re: xpath query - ignore case sensitive


Hello All
A few week ago I asked a question relating to this topic....A friend at the
forum gave his help but I could not get it right.
I have a form that is filled for first name, last name, address, etc.
If I fill the name John (with capital J) and then query the collection for
john (with small j), I should get this result but am not getting it, as
xpath is distinguishing between small and capital letters.
The XPath string is as follow:
xpath = //person[FirstName = 'John']
Can someone help me and give any clue of how can the query be generally made


for ignoreCase.

Thanks.

>From: Thomas Rupp <[EMAIL PROTECTED]>
>Reply-To: xindice-users@xml.apache.org
>To: xindice-users@xml.apache.org
>Subject: xpath query - ignore case sensitive
>Date: Tue, 7 May 2002 12:08:45 +0200 (MEST)
>
>It is possible to make a xpath query for strings and ignore upper/lower
>characters.
>
>--
>GMX - Die Kommunikationsplattform im Internet.
>http://www.gmx.net
>


_________________________________________________________________ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com

_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.



Reply via email to