if( var.getValue().getItemType() != Type.JAVA_OBJECT ) {
throw( new XPathException( this, "Variable $request is not bound to a Java object." ) );
}
JavaObjectValue request = (JavaObjectValue)var.getValue().itemAt( 0 );
// get attribute name parameter
String attribName = getArgument( 0 ).eval( contextSequence, contextItem ).getStringValue();
Sequence attribValue = getArgument( 1 ).eval( contextSequence, contextItem );
if( request.getObject() instanceof RequestWrapper ) {
((RequestWrapper)request.getObject()).setAttribute( attribName, attribValue );
} else {
throw( new XPathException( this, "Type error: variable $request is not bound to a request object" ) );
}
return( Sequence.EMPTY_SEQUENCE );