}
public void testCantBindNonPrefix() {
XPathContext context = new XPathContext();
try {
context.addNamespace("foo:bar", "http://www.example.org");
fail("Allowed preix with colon");
}
catch (IllegalNameException success) {
assertNotNull(success.getMessage());
}
try {
context.addNamespace("foo bar", "http://www.example.org");
fail("Allowed preix with space");
}
catch (IllegalNameException success) {
assertNotNull(success.getMessage());
}