First off, thanks for providing this open source XML library.
I have been using with pleasure for a while now.

The two methods mentioned above are not doing their job correctly, though.

I have dom4j 1.5.2, JDK 1.4.2_07 on Windows2000.

Try this:

import org.dom4j.Document;
import org.dom4j.DocumentHelper;


public class TestDom4J
{
    public static void main(String[] args) throws Exception {
        String xml = "<?xml version='1.0' encoding='iso-8859-1'?><Message>Hi
there</Message>";
        Document doc = DocumentHelper.parseText (xml);
        System.out.println ("The encoding is " + doc.getXMLEncoding ());
        System.out.println ("As XML: " + doc.asXML ());
    }
}

The result is:

The encoding is null
As XML: <?xml version="1.0" encoding="UTF-8"?>
<Message>Hi there</Message>

Besides, where can I open a defect ?

I have not found a link.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
dom4j-dev mailing list
dom4j-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to