Sorry for replying this late. > Element root = DocumentHelper.createElement("urlset"); > root.addNamespace("", "http://www.sitemaps.org/schemas/sitemap/0.9"); > Document doc = DocumentHelper.createDocument(root); > > I end up with a structure like : > <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> > <url xmlns=""> > <loc>...
The problem is that you will have to specify the namespace specifically on every element you create, otherwise dom4j assumes that the element is in no namespace. Regards, Edwin -- http://www.edankert.com/ ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ dom4j-user mailing list dom4j-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dom4j-user