diff --git a/source/java/org/alfresco/repo/jscript/Node.java b/source/java/org/alfresco/repo/jscript/Node.java index de3c1d38b4..8df8247728 100644 --- a/source/java/org/alfresco/repo/jscript/Node.java +++ b/source/java/org/alfresco/repo/jscript/Node.java @@ -288,7 +288,7 @@ public final class Node implements Serializable /** * @return Returns the Nodes at the specified XPath walking the children of this Node. - * So a valid call might be mynode.childrenByXPath("/*[@cm:name='Testing']/*"); + * So a valid call might be mynode.childrenByXPath("*[@cm:name='Testing']/*"); */ public Node[] childrenByXPath(String xpath) { @@ -1134,17 +1134,8 @@ public final class Node implements Serializable if (logger.isDebugEnabled()) logger.debug("Executing xpath: " + xpath); - NodeRef contextRef; - if (getParent() != null) - { - contextRef = getParent().getNodeRef(); - } - else - { - contextRef = this.nodeService.getRootNode(nodeRef.getStoreRef()); - } List nodes = this.services.getSearchService().selectNodes( - contextRef, + this.nodeRef, xpath, null, this.services.getNamespaceService(),