xml-xindice-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Schuster" <Christian.Schus...@edv-konzepte.com>
Subject AW: XPath /case sensitiv
Date Thu, 30 Oct 2003 08:45:32 GMT
Hi,

this Statement works for me, although it is not fast and not nice (Java Syntax):

  xPathQuery =  this.collection[i] + 
                "[starts-with(translate(." +
                this.field[i] +
                ", 'ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜÁÀÉÈÍÌÓÒÚÙ'" +
                ", 'abcdefghijklmnopqrstuvwxyzäöüáàéèíìóòúù')" +
                ", '" +
                this.searchFor[i].toLowerCase()+
                "')]";

The Result Query looks like this:

/Person[starts-with(translate(./Name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜÁÀÉÈÍÌÓÒÚÙ',
'abcdefghijklmnopqrstuvwxyzäöüáàéèíìóòúù'),'daniela')]

Note that 'daniela' has to be complete lower case in the statement.
"starts-with" can be replaced by "contains"


Christian


-----Ursprüngliche Nachricht-----
Von: Juergen Niehoff [mailto:niehoff@et.fh-osnabrueck.de]
Gesendet: Mittwoch, 29. Oktober 2003 11:03
An: xindice-users@xml.apache.org
Betreff: XPath /case sensitiv


Hello,

did anyone know if it is possible to make  a XPath-Statement that is not 
case sensitiv?

If i am searching for  "Daniela" my XPath looks like 
".../[contains(../NODE, 'Daniela')]" in some documents there was an 
"daniela" and that Docuemnts where not found. I can switch the first 
letter to lowercase(or to uppercase) with String-Operations and then my 
XPath could by look like "../[cantains(../NODE, 'Daniela') or 
contains(../NODE, 'daniela')]" , but this is not a good way.



Jürgen



Mime
View raw message