throw new FactoryException(e);
}
}
protected NamespaceContext createNamespaceContext(Configuration configuration) {
SimpleNamespaceContext answer = new SimpleNamespaceContext();
String[] names = configuration.getAttributeNames();
for (int i = 0; i < names.length; i++) {
String name = names[i];
if (name.equals("xmlns")) {
answer.addNamespace("", configuration.getAttribute(name));
}
else {
if (name.startsWith("xmlns:")) {
String prefix = name.substring(6);
String uri = configuration.getAttribute(name);
answer.addNamespace(prefix, uri);
}
}
}
return answer;
}