cancel
Showing results for 
Search instead for 
Did you mean: 

NodeName Issues

singhr
Champ in-the-making
Champ in-the-making
Hi,

Inside alfresco repository, I created following structure:
My Alfresco > Research Docs> 2

How to refer to Node "2" using XPATH Query;
Programatically, I tried to refer it using:
      String location = "/app:company_home/app:user_homes/sys:singhr/cm:Research_x0020_Docs/cm:2";

But i get this error:
<<<…error message truncated for simplicity>>>

Caused by: org.jaxen.XPathSyntaxException: Unexpected '<'
        at org.jaxen.BaseXPath.<init>(BaseXPath.java:132)
        at org.jaxen.BaseXPath.<init>(BaseXPath.java:153)
        at org.alfresco.repo.search.NodeServiceXPath.<init>(NodeServiceXPath.java:115)
        at org.alfresco.repo.search.impl.NodeSearcher.selectNodes(NodeSearcher.java:133)
        … 57 more
Caused by: class org.jaxen.saxpath.XPathSyntaxException: /app:company_home/app:user_homes/sys:singhr/cm:<<CLSA Research>>: 48: Unexpected '<'
        at org.jaxen.saxpath.base.XPathReader.createSyntaxException(XPathReader.java:1120)
        at org.jaxen.saxpath.base.XPathReader.pathExpr(XPathReader.java:204)
        at org.jaxen.saxpath.base.XPathReader.unionExpr(XPathReader.java:1044)
        at org.jaxen.saxpath.base.XPathReader.unaryExpr(XPathReader.java:1032)
        at org.jaxen.saxpath.base.XPathReader.multiplicativeExpr(XPathReader.java:981)
        at org.jaxen.saxpath.base.XPathReader.additiveExpr(XPathReader.java:951)
        at org.jaxen.saxpath.base.XPathReader.relationalExpr(XPathReader.java:915)
        at org.jaxen.saxpath.base.XPathReader.equalityExpr(XPathReader.java:867)
        at org.jaxen.saxpath.base.XPathReader.andExpr(XPathReader.java:847)
        at org.jaxen.saxpath.base.XPathReader.orExpr(XPathReader.java:825)
        at org.jaxen.saxpath.base.XPathReader.expr(XPathReader.java:818)
        at org.jaxen.saxpath.base.XPathReader.parse(XPathReader.java:113)
        at org.jaxen.BaseXPath.<init>(BaseXPath.java:127)
        … 60 more
2 REPLIES 2

zaizi
Champ in-the-making
Champ in-the-making
try

String location = "/app:company_home/app:user_homes/sys:singhr/cm:Research_x0020_Docs/cm:_x0032_

singhr
Champ in-the-making
Champ in-the-making
Thanks zaizi, it helped.

org.alfresco.webservice.util.ISO9075 utility needs to be used for handling nodes whose names are numbers.