jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Exception when creating a node with &
Date Sat, 20 Sep 2008 20:32:25 GMT
Hi,

On Fri, Sep 19, 2008 at 9:05 PM, VenkiSM
<venka.balasubramaniy@sourcemedia.com> wrote:
>    We are using JR as content repository and when creating a node as
> Query query = queryManager.createQuery(queryString, Query.XPATH);
>
> where queryString takes values "//PRINT/CARDS & PAYMENTS and and Query.XPATH
> is "xpath".
>
> Exception is thrown at this point....

You'll need to encode any characters that are not valid in XML names.
The ISO9075 class in jackrabbit-jcr-commons implements the required
encoding mechanism. You can use it for example like this:

    import org.apache.jackrabbit.util.ISO9075;
    String queryString =
        "//" + ISO9075.encodePath("PRINT/CARDS & PAYMENTS");

BR,

Jukka Zitting

Mime
View raw message