Hi David,

if you want to convert these characters greater than 0x7f, you'll have to create your xml like this:

org.dom4j.Document document = [...]
org.dom4j.io.XMLWriter writer = new org.dom4j.io.XMLWriter();
java.io.StringWriter strWriter = new java.io.StringWriter();
writer.setWriter(strWriter);
writer.setMaximumAllowedCharacter(127);
writer.write(document);
String xml = strWriter.toString();

regards,
Maarten


David Thielen wrote:

Hi;

I am creating a DOM using Document and Element.setText(). The created xml from Document.asXML() is set to encoding=”utf-8”. However, it appears that while it converts items like < to &lt;, it doesn’t convert chars that are greater than 0x7f to their utf-8 value. Is there something special I have to do?

Thanks - dave






------------------------------------------------------- This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to