> Hi All,
> I'm using XMLBeans for generating xml files. But it doesn't seem to be
> printing the XML Header line at the top - <?xml version="1.0"
> encoding="UTF-8"?>. Can someone tell me how to get XMLBeans to add this
> to the XML?
You can't - or rather, you should not. I guess that XMLBeans uses
Reader and Writer (i.e. character streams) to read from and write to.
It does not know the encoding of the stream. So you have to write it
yourself.
robert
Gugle - 20 Dec 2006 10:40 GMT
But I'm setting the encoding type through the XMLOptions object as
follows:
XmlOptions opts = new XmlOptions();
opts.setCharacterEncoding("UTF-8");
//xmlDoc.documentProperties().setEncoding("UTF-8");
xmlDoc.save(writer, opts);
Any idea if XMLBeans will use this value for adding the header?