[ 
https://issues.apache.org/jira/browse/OAK-1077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14052392#comment-14052392
 ] 

Alexander Klimetschek edited comment on OAK-1077 at 7/4/14 12:16 PM:
---------------------------------------------------------------------

Actually, the backlash for the single quote should not be necessary in the java 
code:
{code}
c.addChild("two").setProperty("prop", "exact'quote");
// ...
assertQuery("//*[jcr:contains(., 'exact'quote')]", "xpath", 
ImmutableList.of("/two"));
{code}

But that should not make a difference to the actual string, it should be the 
same, with a single-quote in the middle.

However, it works when there is a backslash plus 2 single-quotes in the 
jcr:contains:

{code}
c.addChild("two").setProperty("prop", "exact\'quote");
// ...
assertQuery("//*[jcr:contains(., 'exact\\''quote')]", "xpath", 
ImmutableList.of("/two"));
{code}



was (Author: alexander.klimetschek):
Actually, the backlash for the single quote should not be necessary in the java 
code:
{code}
c.addChild("two").setProperty("prop", "exact'quote");
// ...
assertQuery("//*[jcr:contains(., 'exact'quote')]", "xpath", 
ImmutableList.of("/two"));
{code}

But that should not make a difference to the actual string, it should be the 
same, with a single-quote in the middle.

> XPath failures for escaped quotes in full-text search
> -----------------------------------------------------
>
>                 Key: OAK-1077
>                 URL: https://issues.apache.org/jira/browse/OAK-1077
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core, query
>            Reporter: Alex Parvulescu
>            Assignee: Alex Parvulescu
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: OAK-1077-test.patch
>
>
> It seems that the query doesn't match when a property is _exact\"quote_ or 
> _exact\'quote_



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to