{throw new XPathException(this, "Variable $session is not bound to an Java object.");}
final JavaObjectValue session = (JavaObjectValue) var.getValue().itemAt(0);
if(session.getObject() instanceof SessionWrapper)
{
final SessionWrapper sessionWrapper = (SessionWrapper)session.getObject();
for(final Enumeration<String> e = sessionWrapper.getAttributeNames(); e.hasMoreElements();)
{
final String attribName = (String) e.nextElement();
sessionWrapper.removeAttribute(attribName);
}
return Sequence.EMPTY_SEQUENCE;
}
else
{throw new XPathException(this, "Type error: variable $session is not bound to a session object");}