* @see com.ibm.xfaces.xpath.XPathExpression#setValue(java.lang.Object,
* java.lang.Object)
*/
protected void doSetValue(Object node, Object value, NamespaceContext nsContext, boolean autoCreate) throws XPathException {
if (node == null) {
throw new XPathException(new NullPointerException("Cannot set a value on a null object")); // $NLS-XmlComplexExpression.Cannotsetavalueonanullobject-1$
}
if (!(node instanceof Node)) {
throw new XPathException(null,"Try to evaluate to set a value on a object that is not a node"); // $NLS-XmlComplexExpression.Trytoevaluatetosetavalueonaobject-1$
}
Node nodeObj = (Node)node;
nsContext = resolveNamespaceContext(nodeObj,nsContext);
XResult r = domDriver.evaluateXPath(nodeObj,compiledXPath,nsContext);
if(r.isEmpty()) {
throw new XPathException(null,"Cannot create XPath {0}",getExpression()); // $NLS-XmlComplexExpression.CannotcreateXPath0-1$
}
if(r.isValue()) {
throw new XPathException(null,"Cannot set a value on a value result, XPath={0}",getExpression()); // $NLS-XmlComplexExpression.CannotsetavalueonavalueresultXPat-1$
}
String strValue = Utils.getAsString(value);
for( Iterator it=r.getNodeIterator(); it.hasNext(); ) {
Object n = (Object)it.next();
if( n instanceof Node ) {