Consultor Eletrônico



Kbase P103006: XML SAVE() method adds additional carriage return with embedded image
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/29/2005
Status: Unverified

FACT(s) (Environment):

Progress 9.1x

SYMPTOM(s):

The the XML SAVE() method adds an additional carriage return (<CR> character) to the end of each line of the XML data.

XML file contains an embedded .jpg image that has been converted to a Base64 output file.


This happens, e.g., using the following code :

DEFINE VAR hText AS HANDLE.
DEFINE VAR hdoc AS HANDLE.
DEFINE VAR bb AS CHARACTER.

hText:MEMPTR-TO-NODE-VALUE(bb).
hdoc:SAVE("file","myfile.xml").

Opening the XML file in a HEX editor normally shows each line in the Base64 file to end with hexadecimal value "0D 0A".
The SAVE() method causes each line in the XML file to terminate with value "0D 0D 0A".

CAUSE:

This is a known issue being investigated by development.

FIX:


As a workaround use a STREAM mode with the SAVE() method.
For example:

DEFINE STREAM outStream.
OUTPUT STREAM outStream TO myfile2.xml.
hdoc:SAVE("stream","outStream").
OUTPUT CLOSE.