XML header encoding
Hi All,
this question may have been asked a lot of times but i'm not able to find a clear answer.
Previously i use DTD to validate XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE config_jre SYSTEM"myFile.dtd">
<root>
and the java snippet used when i encode the xml file
Element root =new Element("root");
Document doc=new Document(root);
DocType docType =new DocType("root");
docType.setSystemID("myFile.dtd");
doc.setDocType(docType);
For some reasons, i change the xml validation and choose XSD
(allowing range checking, ...)
the header of the xml becomes
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
the problem is that i don't know how to add this attribute to the node.
i tried as a standard attribute but the execution failed telling that
an attribute with colons is forbidden
any help would be appreciated

