If I recall correctly, if you want to use paths in XPath queries then you
need to escape the path segments according to ISO9075 rules.   For your
referenced, there is a brief section about that on the wiki at [1].

Also, there is a utility class in jackrabbit that can do the ISO9075 path
encoding for you at [2] that you may utilize.

1.
http://jackrabbit.apache.org/archive/wiki/JCR/EncodingAndEscaping_115513396.html
2.
http://jackrabbit.apache.org/api/trunk/org/apache/jackrabbit/util/ISO9075.html

I hope that helps.

On Thu, Aug 29, 2019 at 8:54 AM Roy Teeuwen <r...@teeuwen.be> wrote:

> Hey all,
>
> In the framework that we use (AEM) there is a folder structure as
> following:
>
> /content/launches/2019/08/29/my-launch/content/site-name
>
> I would like to do a query to search for subresources in this site, but it
> seems that this gives issues because an xpath query cannot take numbers as
> path names:
>
> /jcr:root/content/launches/2019(*)/08/29/my-launch/content/site-name//*[@sling:resourceType='some/components/path'];
> expected: jcr:root, /, *, @, (, .
>
> Is there any way around this to still make it work with xpath queries? Can
> I escape it in any way? Or can I say "start the query below
> /content/launches/2019/08/29/my-launch/content/site-name so that it doesnt
> see the numbers in the query
>
> Thanks!
> Roy
>
>

Reply via email to