Hi Sébastien, Thanks for your answer. After ISO9075 encoding the XPath query string as well, it now works.
I wasn't aware that I always have to encode the query whether it's already encoded or not. I thought when I initially encode the node names then I would always have valid paths to use in the queries straight away. BR, Leander > -----Ursprüngliche Nachricht----- > Von: Sébastien Launay [mailto:[email protected]] > Gesendet: Montag, 2. März 2009 17:04 > An: [email protected] > Betreff: Re: Problem with ISO9075 encoded name in XPath Query? > > Hi Mario, > > ISO9075 musts be used when creating an XPath Query whether a segment > has been encoded or not. > Therefore, i think you need to double encode the segment with: > Node name stored = "Test_x0020_Company" > Node name for query = "Test_x005F_x0020_x005F_Company" > > => > /jcr:root/application/com/testcompany/Test_x005F_x0020_x005F_Company//e > lement(*)[type='IMAGE'] > > I do not think that this encoding is necessary for storing if it is > just for avoiding spaces problems, as spaces are allowed in node name > (but not at the beginning). > > Note that the same problem will occurs if you have a node name starting > with a number, it must be encoded with ISO9075 in the query. > > Mario-Leander Reimer a écrit : > > 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 > -- > Sébastien Launay 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.
