On Tue, Jan 20, 2009 at 10:39 PM, Torgeir Veimo <[email protected]> wrote:
> I seem to be able to successfully create nodes with names starting with a
> number, but I cannot search for them with the query string eg.
>
> /jcr:root/nen:content/people/5cb31fb82acd41b29fceaa7536cc74a6/nen:wall//element(*,nen:message)
>
> when I've successfully created a node with name
> /jcr:root/nen:content/people/5cb31fb82acd41b29fceaa7536cc74a6/
>
> I had a quick glance in the 170 spec, and I couldn't find any indication
> that a node cannot start with a number, at least not in section 4.6 Path
> Syntax.
>
> Should I escape the name when creating the node, so that it doesn't start
> with a name, or should I escape the search, or is there a bug in the query
> parser?

JCR node names can start with numbers, but leading digits in XPath
queries need to be escaped. You can use the
org.apache.jackrabbit.util.ISO9075 helper class from
jackrabbit-jcr-commons [1] for that, which Vijay already mentioned.

[1] http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/util/ISO9075.html

Regards,
Alex

-- 
Alexander Klimetschek
[email protected]

Reply via email to