mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
XPath function usage exceptions
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2211 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -380,12 +380,11 @@ public class NodeServiceXPath extends BaseXPath
|
|||||||
|
|
||||||
public Object call(Context context, List args) throws FunctionCallException
|
public Object call(Context context, List args) throws FunctionCallException
|
||||||
{
|
{
|
||||||
if (args.size() == 1)
|
if (args.size() != 1)
|
||||||
{
|
{
|
||||||
return evaluate(context.getNodeSet(), args.get(0), context.getNavigator());
|
throw new FunctionCallException("contains() usage: contains('pattern')");
|
||||||
}
|
}
|
||||||
|
return evaluate(context.getNodeSet(), args.get(0), context.getNavigator());
|
||||||
throw new FunctionCallException("contains() requires one argument.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object evaluate(List nodes, Object pattern, Navigator nav)
|
public Object evaluate(List nodes, Object pattern, Navigator nav)
|
||||||
@@ -403,8 +402,9 @@ public class NodeServiceXPath extends BaseXPath
|
|||||||
}
|
}
|
||||||
else if (nav.isAttribute(nodes.get(0)))
|
else if (nav.isAttribute(nodes.get(0)))
|
||||||
{
|
{
|
||||||
qname = QName.createQName(nav.getAttributeNamespaceUri(nodes.get(0)), ISO9075.decode(nav
|
qname = QName.createQName(
|
||||||
.getAttributeName(nodes.get(0))));
|
nav.getAttributeNamespaceUri(nodes.get(0)),
|
||||||
|
ISO9075.decode(nav.getAttributeName(nodes.get(0))));
|
||||||
nodeRef = ((DocumentNavigator.Property) nodes.get(0)).parent;
|
nodeRef = ((DocumentNavigator.Property) nodes.get(0)).parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -463,7 +463,9 @@ public class NodeServiceXPath extends BaseXPath
|
|||||||
}
|
}
|
||||||
else if (nav.isAttribute(target))
|
else if (nav.isAttribute(target))
|
||||||
{
|
{
|
||||||
qname = QName.createQName(nav.getAttributeNamespaceUri(target), ISO9075.decode(nav.getAttributeName(target)));
|
qname = QName.createQName(
|
||||||
|
nav.getAttributeNamespaceUri(target),
|
||||||
|
ISO9075.decode(nav.getAttributeName(target)));
|
||||||
nodeRef = ((DocumentNavigator.Property) target).parent;
|
nodeRef = ((DocumentNavigator.Property) target).parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user