static IDynamicContextFactory createInstance(DynamicContextImpl dCtx) {
IStaticContextFactory scFactory = dCtx.getStaticContext().createFactory();
final int dtLen = XSDateTimePointable.TYPE_TRAITS.getFixedLength();
byte[] currentDateTime = new byte[dtLen];
XSDateTimePointable datetimep = new XSDateTimePointable();
datetimep.set(currentDateTime, 0, dtLen);
datetimep.setCurrentDateTime();
Map<QName, ArrayBackedValueStorage> vMap = dCtx.getVariableMap();
int nVars = vMap.size();
QName[] variableNames = new QName[nVars];
int[] valueOffsets = new int[nVars];