Hi all,

I use castor 0.9.5.3 to generate Java classes from XML schema. I have a
class Resultmessage which contains a set of Element. I use the following
code to test the marshal and unmarshal.
---------------
        StringWriter output = new StringWriter();
        Resultmessage data = new Resultmessage() ;
        Element m2 = new Element();
        m2.setElementContent("<?xml version=\"1.0\"
encoding=\"UTF-8\"?><sensordata name=\"path.delay.roundtrip\"
resourceID=\"aaaaa\"><eventtime>1077637973125</eventtime><hostname>kim</hostname><destination>bridge.vcpc.univie.ac.at</destination><min>2</min><avg>2</avg><max>2</max></sensordata>");
        data.addElement(m2);
        data.setHandle("linh");
        try {
            data.marshal(output);
            System.out.println("Marshal Output");
            System.out.println(output.toString());
            Resultmessage data2 = (Resultmessage)Resultmessage.unmarshal(new 
StringReader(output.toString()));
            System.out.println(data2.getElement(0).getElementContent());
        }
        catch (Exception e) {e.printStackTrace();}
---------------
However, the element content of data2 is different from that of data:

<?xml version="1.0"encoding="UTF-8"?><sensordata
name="path.delay.roundtrip"resourceID="aaaaa"><eventtime>1077637973125</eventtime><hostname>kim</hostname><destination>bridge.vcpc.univie.ac.at</destination><min>2</min><avg>2</avg><max>2</max></sensordata>

As you can see we lost spaces before "encoding", resourceID.

I did not get this problem with castor 0.9.5.2


Any body helps?

Linh.

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to