jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Skinner" <shedloadsofb...@hotmail.com>
Subject RE: Searching "&" character
Date Fri, 09 Feb 2007 09:07:15 GMT

Hi Jaka,

& is a reserved character in xpath queries for indicating the start of an 
entity reference. Try and encode  Dolce&Gabbana  as  Dolce_x0026_Gabbana  
and then encode the search string accordingly.


>Is it possible to perform a full-text search for a string containing an "&"
>For example this query:
>	//element(*, nt:file)[jcr:contains(., 'Dolce&Gabbana')]
>... produces the following error:
>	Encountered: "G" (71), after : "\'Dolce&"
>... presumably because it expects an XML entity following the "&".
>However, if I replace the "&" with an "&amp;", the query works, but finds 
>only literal "&amp;"
strings (e.g. "Dolce&amp;Gabbana"), which is useless.
>Is there another way to properly escape the "&" character?
>Thanks & regards,

MSN Hotmail is evolving  check out the new Windows Live Mail 

View raw message