You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Paco Avila <pa...@git.es> on 2007/03/01 10:57:08 UTC

how can I escape invalid chars in node name?

Can I escape invalid chars as : and * to be included in a node name?
-- 
GIT Consultors S.L.
c\ Francesc Rover 2-B
07003 Palma de Mallorca
(Illes Balears)


Re: how can I escape invalid chars in node name?

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 3/1/07, Julian Reschke <ju...@gmx.de> wrote:
> Jukka Zitting schrieb:
> > There is a slow ongoing debate about how to best handle such names,
> > and whether there should be some standard escaping mechanism. My best
> > advice would be to use a string property if you want to avoid any
> > restrictions on illegal characters.
>
> Nit: but even with a string property there some characters will be
> illegal, right? Or wasn't that the agreed-upon answer on what to do with
> string properties that contain characters not allowed in XML (1.0)
> content (such as most control characters)?

No, the illegal XML characters only cause trouble with the XML import
and export features (see JCR-674). There should be no restrictions
when string properties are accessed using the normal JCR API methods -
anything you can express in UTF-16 (as used by Java) should be OK with
Jackrabbit.

BR,

Jukka Zitting

Re: how can I escape invalid chars in node name?

Posted by Julian Reschke <ju...@gmx.de>.
Jukka Zitting schrieb:
> Hi,
> 
> On 3/1/07, Paco Avila <pa...@git.es> wrote:
>> Can I escape invalid chars as : and * to be included in a node name?
> 
> You can, for example by using URI encoding or some similar mechanism.
> 
> There is a slow ongoing debate about how to best handle such names,
> and whether there should be some standard escaping mechanism. My best
> advice would be to use a string property if you want to avoid any
> restrictions on illegal characters.

Nit: but even with a string property there some characters will be 
illegal, right? Or wasn't that the agreed-upon answer on what to do with 
string properties that contain characters not allowed in XML (1.0) 
content (such as most control characters)?

Best regards, Julian


Re: how can I escape invalid chars in node name?

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 3/1/07, Paco Avila <pa...@git.es> wrote:
> Can I escape invalid chars as : and * to be included in a node name?

You can, for example by using URI encoding or some similar mechanism.

There is a slow ongoing debate about how to best handle such names,
and whether there should be some standard escaping mechanism. My best
advice would be to use a string property if you want to avoid any
restrictions on illegal characters.

BR,

Jukka Zitting