Edwin It is ok that addText escapes characters and works well, the problem is with parseText. Is there a bug in that function (workaround ?) or there is a magic adjustment like setting output encoding ?
Best regards Heitor -----Mensagem original----- De: Edwin Dankert [mailto:[EMAIL PROTECTED] Enviada: seg 8/15/2005 8:36 Para: Heitor Barbieri Cc: dom4j-user@lists.sourceforge.net Assunto: Re: [dom4j-user] parseText() The addText method always escapes characters like '&' and '<' otherwise the output XML would not be well-formed. Regards, Edwin On 7/25/05, Heitor Barbieri <[EMAIL PROTECTED]> wrote: > > Why do I get different outputs for the 'root' element in the following > program ? How can I get > the same output using partText ? > > > Element root1 = DocumentHelper.createElement( "root" ).addText( > "=" ); > Document document = > DocumentHelper.parseText("<root>=</root>"); > > System.out.println(root1.asXML()); > System.out.println(document.asXML()); > > --------------------------------------------------------------------------------------------------- > Output: > > <root>&#8804;</root> > <?xml version="1.0" encoding="UTF-8"?> > <root>?</root> > > Thanks in advance > > Heitor > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > dom4j-user mailing list > dom4j-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/dom4j-user > ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ dom4j-user mailing list dom4j-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dom4j-user