How can i create the header of a XML Document, which was created by using XML Beans and XMLOptions?
I have developed this kind of java code to the right encoding and deleted unnecessary namespaces:
final Map<String, String> implicitNamespaces = new HashMap<String, String>();
implicitNamespaces.put("", "http://www.test.com/results");
XmlOptions xmlOptions = new XmlOptions();
xmlOptions.setSaveImplicitNamespaces(implicitNamespaces);
xmlOptions.setCharacterEncoding("ISO-8859-1");
xmlOptions.setSavePrettyPrint();
But how can i create the header by using XMLBeans and XMLOptions? Is it the only way to set it hard coded? If there is´t a method to create this tag?
The
<?xml version=“1.0” encoding=“ISO-8859-1”?>
construct is an XML declaration.Per org.apache.xmlbeans.save(ContentHandler ch, LexicalHandler lh):