Hi Dave, I encode the name because and did not want to restrict the user in any way regarding allowed characters for the "name" of an entity (which I use as node name) I store in JCR. Otherwise I would have to manage 2 names, the "artificial" valid JCR node name and the "real name" for the entity the user initially entered, and keep both in-synch. Same for nt:files a user can upload: a filename can start with a letter, the node name can't. So either strip the invalid characters and lose the original filename, or encode it somehow.
So I figured it's best to always encode every name, not matter what. Well, now I additionally have to encode the XPath query. Thanks again, BR, Leander > -----Ursprüngliche Nachricht----- > Von: Dave Brosius [mailto:[email protected]] > Gesendet: Montag, 2. März 2009 17:09 > An: [email protected] > Betreff: Re: Problem with ISO9075 encoded name in XPath Query? > > Don't encode the name when you save it. > Only encode the name when using xpath. > > > ----- Original Message ----- > From: "Mario-Leander Reimer" <[email protected]> > To: <[email protected]> > Sent: Monday, March 02, 2009 10:29 AM > Subject: Problem with ISO9075 encoded name in XPath Query? > > > 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(*)[ty > pe='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='IMA > GE'] > > 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 > ----------------------------------------------------------------------- > ---- > VVA Networks GmbH > : medien mit zukunft > Geisenhausenerstra?e 15-17 > 81379 M?nchen > Deutschland > ----------------------------------------------------------------------- > ---- > Fon: +49 89 2000375-610 > Fax: +49 89 2000375-699 > Mobil: +49 173 5883541 > ----------------------------------------------------------------------- > ---- > [email protected] > www.vva-networks.de > > ----------------------------------------------------------------------- > HRB 33884 D?sseldorf > Gesch?ftsf?hrer Rolf Christian Kassel > ----------------------------------------------------------------------- > Ein Unternehmen der VVA Kommunikation > http://www.vva.de > ----------------------------------------------------------------------- > omnisuite(r) - integrate. automate. communicate. > http://www.omnisuite.de > ----------------------------------------------------------------------- > > Diese Nachricht (inklusive aller Anh?nge) ist vertraulich. Sie darf > ausschlie?lich durch den vorgesehenen Empf?nger und Adressaten gelesen, > kopiert oder genutzt werden. Sollten Sie diese Nachricht versehentlich > erhalten haben, bitten wir, den Absender (durch Antwort-E-Mail) hiervon > unverz?glich zu informieren und die Nachricht zu l?schen. Jede > unerlaubte > Nutzung oder Weitergabe des Inhalts dieser Nachricht, sei es > vollst?ndig > oder teilweise, ist unzul?ssig. > > This message (including any attachments) is confidential and may be > privileged. It may be read, copied and used only by the intended > recipient. > If you have received it in error please contact the sender (by return > E-Mail) immediately and delete this message. Any unauthorised use or > dissemination of this message in whole or in part is strictly > prohibited. VVA Networks GmbH Mario-Leander Reimer Dipl.-Inf. (FH) Teamleitung Publishing Solutions --------------------------------------------------------------------------- VVA Networks GmbH : medien mit zukunft Geisenhausenerstraße 15-17 81379 München Deutschland --------------------------------------------------------------------------- Fon: +49 89 2000375-610 Fax: +49 89 2000375-699 Mobil: +49 173 5883541 --------------------------------------------------------------------------- [email protected] www.vva-networks.de ----------------------------------------------------------------------- HRB 33884 Düsseldorf Geschäftsführer Rolf Christian Kassel ----------------------------------------------------------------------- Ein Unternehmen der VVA Kommunikation http://www.vva.de ----------------------------------------------------------------------- omnisuite® - integrate. automate. communicate. http://www.omnisuite.de ----------------------------------------------------------------------- Diese Nachricht (inklusive aller Anhänge) ist vertraulich. Sie darf ausschließlich durch den vorgesehenen Empfänger und Adressaten gelesen, kopiert oder genutzt werden. Sollten Sie diese Nachricht versehentlich erhalten haben, bitten wir, den Absender (durch Antwort-E-Mail) hiervon unverzüglich zu informieren und die Nachricht zu löschen. Jede unerlaubte Nutzung oder Weitergabe des Inhalts dieser Nachricht, sei es vollständig oder teilweise, ist unzulässig. This message (including any attachments) is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error please contact the sender (by return E-Mail) immediately and delete this message. Any unauthorised use or dissemination of this message in whole or in part is strictly prohibited.
