new ContextSupport(baseContextSupport.getNamespaceContext(),
new SynapseXPathFunctionContext(baseContextSupport.getFunctionContext(), synCtx),
new SynapseXPathVariableContext(baseContextSupport.getVariableContext(), synCtx),
baseContextSupport.getNavigator());
Context context = new Context(contextSupport);
context.setNodeSet(new SingletonList(synCtx.getEnvelope()));
return context;
} else if (obj instanceof SOAPEnvelope) {
SOAPEnvelope env = (SOAPEnvelope)obj;
ContextSupport baseContextSupport = getContextSupport();
ContextSupport contextSupport =
new ContextSupport(baseContextSupport.getNamespaceContext(),
baseContextSupport.getFunctionContext(),
new SynapseXPathVariableContext(baseContextSupport.getVariableContext(), env),
baseContextSupport.getNavigator());
Context context = new Context(contextSupport);
context.setNodeSet(new SingletonList(env));
return context;
} else {
return super.getContext(obj);
}
}