fDynamicContext = new DefaultDynamicContext(schema, document);
// populate the 'PsychoPath XPath 2' static context, with namespace
// bindings derived from the XML Schema document.
NamespaceSupport xpath2NamespaceContext = (NamespaceSupport)
psychoPathParams.get("XPATH2_NS_CONTEXT");
Enumeration currPrefixes = xpath2NamespaceContext.getAllPrefixes();
while (currPrefixes.hasMoreElements()) {
String prefix = (String)currPrefixes.nextElement();
String uri = xpath2NamespaceContext.getURI(prefix);
fDynamicContext.add_namespace(prefix, uri);
}
fDynamicContext.add_function_library(new FnFunctionLibrary());
fDynamicContext.add_function_library(new XSCtrLibrary());