So If someone enters in a form field a query string "rock AND roll OR disco 
-techno" 
I cannot just use it in jcr:contains - I have to tokenize the string and use 
multiple jcr:contains.
SO instead of:

jcr:contains(.,'rock AND roll OR disco -techno')

I have to do:

jcr:contains(.,'rock') and jcr:contains(.,'roll') or jcr:contains(.,'disco') 
and not jcr:contains(.,'techno')

Is that correct?
If, so are there any utilities that would take a natural query and produce a 
valid xpath?


Thanks
 
Amir
 

> -----Original Message-----
> From: Marcel Reutegger [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, June 20, 2007 10:01 AM
> To: [email protected]
> Subject: Re: XPath difference in queries
> 
> Amir Mistric wrote:
> > Does this mean if I have a form in which user is entering 
> search query 
> > I don't have to "build" (tokenize, validate, reconstruct, etc, etc) 
> > the XPAth query... I can just pass in something like
> > 
> > jcr:contains(.,'rock AND roll OR disco -techno') and it will work?
> 
> no, that doesn't work you have to create a valid XPath statement.
> 
> > Would I have to take care of the last point (escape special 
> chars) or 
> > is that done automatically?
> 
> you have to do that manually.
> 
> regards
>   marcel
> 

Reply via email to