Try this:
DocumentFactory documentFactory = new DocumentFactory();
Element el = documentFactory.createElement(QName.get("OAI-PMH", "",
"http://www.openarchives.org/OAI/2.0/";));
el.addAttribute(
QName.get("schemaLocation", "xsi",
"http://www.w3.org/2001/XMLSchema-instance";),
"http:
I'm sorry, it seems Document.Factory.createNamespace() works slightly
different from new Namespace(). So instead of null namespace prefix
use empty string:
Namespace ns = documentFactory.createNamespace("",
"http://www.w3.org/2005/Atom";);
Following code works for me:
public static void main(Str