AnsweredAssumed Answered

Namespace prefix problem in Xpath query using api

Question asked by sureshs on Jun 12, 2009
Latest reply on Apr 27, 2011 by merelv

I have a space named RedArea inside company_home, my requirement is to retrieve the meta data/properties namely tags of all the documents(inserted at the time of upload) of that particular space,

When i used the following query in Node Browser of Alfresco, it gave me correct result. 


but when i try to use the same in the following api, inside amps

List<Serializable> result = searchService.selectProperties(rootNodeRef, "//cm:RedArea//@test:tags", null, namespacePrefixResolver, false);
iam getting the following exception….

org.jaxen.UnresolvableException: XPath expression uses unbound namespace prefix cm org.jaxen.expr.DefaultNameStep.evaluate( org.jaxen.expr.DefaultLocationPath.evaluate( org.jaxen.expr.DefaultAbsoluteLocationPath.evaluate( org.jaxen.expr.DefaultXPathExpr.asList( org.jaxen.BaseXPath.selectNodesForContext( org.jaxen.BaseXPath.selectNodes( sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke

Can anyone please help me to solve the above issue…

Thanks in prior