namespaceURLs);
}
public void testGetFunction() throws Exception {
NamespacePrefixTracker namespacePrefixTracker =
new DefaultNamespacePrefixTracker();
JXPathFunctions functions =
new JXPathFunctions(namespacePrefixTracker);
ImmutableExpandedName nameA =
new ImmutableExpandedName("http://spaceA",
"a");
ImmutableExpandedName nameB = new ImmutableExpandedName("", "b");
ImmutableExpandedName nameC =
new ImmutableExpandedName("http://spaceC",
"c");
Function a = new TestFunction();
Function b = new TestFunction();
functions.addFunction(nameA, a);
functions.addFunction(nameB, b);
// Add the non-default prefixes
namespacePrefixTracker.startPrefixMapping("spaceA",
nameA.getNamespaceURI());
namespacePrefixTracker.startPrefixMapping("spaceC",
nameC.getNamespaceURI());
assertSame("function A",
a,
functions.getFunction("spaceA",