I am trying to create an XML document that will store a Unicode string

inside of the tags.  I noticed that the string that comes back from

the asXML() method seems to garble the string that I set in the

element of my document.

 

Does dom4j support creation of documents with Unicode content?

 

Below is the code that I am using (simplified for readability):

 

  public static String buildClauseXMLString (String myUnicodeString) {

    Document doc =  DocumentHelper.createDocument();

    doc.addElement("clause");

    Element rootElement = doc.getRootElement();

    Element element = rootElement.addElement("paragraph");

    element.addCDATA(myUnicodeString);

    return doc.asXML();

  }

 

-Henry

 

Reply via email to