Element e = (Element) iter.next(); e.remove(e.getNamespace()); e.setQName(QName.get(e.getName(), ns.NO_NAMESPACE));
This code specifies an empty namespace for the 'author' element. This causes the xmlns="" to appear. Instead you want to specify the 'author' element in the default "http://www.w3.org/2001/06/grammar" namespace. To fix this, do this instead: Element e = (Element) iter.next(); e.remove(e.getNamespace()); e.setQName(QName.get(e.getName(), ns)); Regards, Edwin -- http://www.edankert.com/ ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ dom4j-user mailing list dom4j-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dom4j-user