jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edgar Poce" <edgarp...@gmail.com>
Subject Re: jcr-commands doesn't handle querys well
Date Sat, 28 Oct 2006 16:12:43 GMT
Hi,

On 10/28/06, Roland Kofler <roland.kofler@systemone.at> wrote:
>
> Hello!
> something like this doesnt work in jcr-commands:
> xpathquery //element(*,s1NT:wikiPage)[@s1title='roland.kofler']
>

The command line tool uses the apostrophe character to delimit an
argument (e.g. the xpath query) then if an apostrophe is inside the
argument it needs to be escaped

try
xpathquery //element(*,s1NT:wikiPage)[@s1title=\'roland.kofler\']

if your query has withespaces you should use:
xpathquery '//element(*,s1NT:wikiPage)[@s1title=\'roland kofler\']'
or
xpathquery "//element(*,s1NT:wikiPage)[@s1title=\'roland kofler\']"

> exception: javax.jcr.query.InvalidQueryException
> message: Only attribute axis is allowed in predicate
>
> but it works in my java code!?
> Is this a bug, and if so how can i help?
>

If you want to see or modify how the command line tool parsers the
user's input see
http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/JcrParser.java?view=markup

br,
edgar

>
> --
> View this message in context: http://www.nabble.com/jcr-commands-doesn%27t-handle-querys-well-tf2529878.html#a7050490
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>

Mime
View raw message