I am trying to create an XML element by including the name space information as its attribute. My code is as follows,
Element root = new Element("APC_DDF");
root.setAttribute("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance");
root.setAttribute("xsi:noNamespaceSchemaLocation","http://localhost/ddf_schema/apc_ddf_1_6.xsd");
root.setAttribute("ddfid", this.dataHolder.getDDFId());
root.setAttribute("ddfname", this.dataHolder.getDDFName());
root.setAttribute("ddfversion", "1");
root.setAttribute("canremove", "yes");
for some reason I am getting the following error,
"Exception in thread "AWT-EventQueue-0" org.jdom2.IllegalNameException: The name "xmlns:xsi" is not legal for JDOM/XML attributes: XML name 'xmlns:xsi' cannot contain the character ":"."
Please help me with the fixes.