The following code should work:

Document document = DocumentHelper.createDocument();

Namespace ns = DocumentHelper.createNamespace("xsi",
                             "http://www.w3.org/2001/XMLSchema-instance";);

Element root = document.addElement(DocumentHelper.createQName("root"));

root.add(ns);
root.addAttribute(
               DocumentHelper.createQName("noNamespaceSchemaLocation", ns),
               "location");
root.addAttribute(DocumentHelper.createQName("version"), "2.0");

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

Reply via email to