Title: FW: the extra whitespaces using xerces1.4.4

Hi Guys,

I am not sure whether or not the following issue is a BUG. Please help me or give me some advice.

Thanks,
George
______________________________________________
From:   George Zhang [mailto:[EMAIL PROTECTED]]
Sent:   February 24, 2006 12:08 PM
To:     '[EMAIL PROTECTED]'
Subject:        the extra whitespaces using xerces1.4.4
Importance:     High

Hi Guys,

I have an weird issue about the org.apache.xml.serialize package. When I tried to transform the XML document into a string, I got the extra whitespaces for the inputted value. The sample is as followed:

    the inputted string in the document: CMD, Test-Ann - exclude Test BMK, CMD Recharge OK
    after transformation, the return value was: CMD, Test -Ann - exclude Test
        BMK, CMD Recharge OK

In this case, I got the extra characters. It is so weird. I am using the xerces1.4.4. Please give me some idea.
Here are the some snipcodes:

        OutputFormat format = new OutputFormat(doc);   //Serialize DOM
            format.setEncoding("ISO-8859-1");
            format.setMethod("xml");
            format.setIndent(2);
            StringWriter stringOut = new StringWriter();  //Writer will be a String
            XMLSerializer serial = new XMLSerializer(stringOut, format);
            serial.asDOMSerializer(); // As a DOM Serializer
            serial.serialize(doc.getDocumentElement());
        xmlResponse = stringOut.toString(); //Spit out DOM as a String

Thanks,
George

Reply via email to