}
if( var.getValue().getItemType() != Type.JAVA_OBJECT ) {
throw( new XPathException( this, "Variable $response is not bound to a Java object." ) );
}
final JavaObjectValue response = (JavaObjectValue)var.getValue().itemAt( 0 );
//get parameters
final String name = getArgument( 0 ).eval( contextSequence, contextItem ).getStringValue();
final long value = new DateTimeValue( getArgument( 1 ).eval( contextSequence, contextItem ).getStringValue() ).getDate().getTime();
//set response header
if( response.getObject() instanceof ResponseWrapper ) {
( (ResponseWrapper)response.getObject() ).setDateHeader( name, value );
} else {
throw( new XPathException( this, "Type error: variable $response is not bound to a response object" ) );
}
return( Sequence.EMPTY_SEQUENCE );