// Get the current request context
MarinerRequestContext requestContext = context.getRequestContext();
PAPIElement element = elementStackEntry.element;
PAPIAttributes attributes = elementStackEntry.attributes;
try {
// Invoke the PAPIElement's elementEnd method.
int result = element.elementEnd(requestContext, attributes);
// Reset the element, make sure that it uses the same context as was
// passed to the elementStart and elementEnd methods.
element.elementReset(requestContext);
// Make sure that the context is correctly cleaned up for the
// elements, this may change the context so do not rely on any
// previously retrieved values being correct.
handler.afterPAPIElement(context, attributes);
// Reset the attributes.
attributes.reset();
switch (result) {
case PAPIConstants.CONTINUE_PROCESSING:
// Do nothing.
break;