You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by Apache Wiki <wi...@apache.org> on 2013/03/06 15:22:47 UTC

[Jackrabbit Wiki] Update of "EncodingAndEscaping" by AlexanderKlimetschek

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" for change notification.

The "EncodingAndEscaping" page has been changed by AlexanderKlimetschek:
http://wiki.apache.org/jackrabbit/EncodingAndEscaping?action=diff&rev1=4&rev2=5

  
  This pages covers escaping/encoding of paths, names, and values in the context of JCR-based web applications.
  
+ == Why? ==
+ 
+ [[http://www.day.com/specs/jcr/2.0/3_Repository_Model.html#3.2%20Names|JCR node names]] have a certain character set, which is actually very broad and includes almost all of unicode minus some special characters such as /, [, ], |, : and * (used to build paths, address same-name siblings etc. in JCR), and it cannot be "." or ".." (obviously).
+ 
+ For XPath queries, the underlying model is that of the JCR repository as an XML document, hence every path step in the XPath is seen as XML name (ISO9075), which is more restrictive than JCR node names and most importantly does not allow names starting with digits. But they can be escaped.
+ 
+ Furthermore, in XPath queries there is the full text search using "jcr:contains()" and this has its own query string format itself, which in Jackrabbit will be that of Lucene.
+ 
+ Then you might often use JCR for web applications where you map URLs to JCR paths - note that JCR node names allow for more than what URLs allow, most notably the space for example.
+ 
- There are utility methods for escaping/encoding in the {{{org.apache.jackrabbit.util.ISO9075}}} and {{{org.apache.jackrabbit.util.Text}}} classes. Although developed under Jackrabbit, they are part of the JCR Commons module which only depends on the JCR API.
+ There are utility methods for escaping/encoding in the {{{org.apache.jackrabbit.util.ISO9075}}} and {{{org.apache.jackrabbit.util.Text}}} classes. Although developed under Jackrabbit, they are part of the JCR Commons module (jackrabbit-jcr-commons) which only depends on the JCR API.
  
  == Escaping paths ==