jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sébastien Launay <sebastien.lau...@anyware-tech.com>
Subject Re: Problem with ISO9075 encoded name in XPath Query?
Date Mon, 02 Mar 2009 16:04:25 GMT
Hi Mario,

ISO9075 musts be used when creating an XPath Query whether a segment
has been encoded or not.
Therefore, i think you need to double encode the segment with:
Node name stored = "Test_x0020_Company"
Node name for query = "Test_x005F_x0020_x005F_Company"

=> /jcr:root/application/com/testcompany/Test_x005F_x0020_x005F_Company//element(*)[type='IMAGE']

I do not think that this encoding is necessary for storing if it is
just for avoiding spaces problems, as spaces are allowed in node name
(but not at the beginning).

Note that the same problem will occurs if you have a node name starting
with a number, it must be encoded with ISO9075 in the query.

Mario-Leander Reimer a écrit :
> Hi Jackrabbit users,
>
> I have a problem with an XPath query in our system when the path contains spaces. Well,
it does not really contain spaces. When we save the node, we encode the name and path with
the ISO9075 class (org.apache.jackrabbit.util.ISO9075)
>
> So the name "Test Company" will result in "Test_x0020_Company"
>
> We then construct an XPath query, something like
>
> /jcr:root/application/com/testcompany/Test_x0020_Company//element(*)[type='IMAGE']
>
> it never returns any results. But if I have a path that has no ISO9075 encoded parts
like
>
> /jcr:root/application/com/testcompany/TestCompany//element(*)[type='IMAGE']
>
> this query works and returns nodes.
>
> Any ideas? What am I doing wrong?
>
> Thanks,
> Leander
>
> VVA Networks GmbH
>
> Mario-Leander Reimer
> Dipl.-Inf. (FH)
> Teamleitung Publishing Solutions
--
Sébastien Launay

Mime
View raw message