Export some data from XMLPort to a bigtext issue

Hi Mibuso!
This is my first post in this forum :)

I have a simple issue, but is not working... maybe you may help...
I'm trying to export some data from XMLPort to a bigtext.
These are my vars and code:

Name DataType Subtype Length
XMLInfoStoc XMLport 50042
tempBlob Record TempBlob
outFile OutStream
Instr InStream
TestText Text 1024



CLEAR(tempBlob);
CLEAR(outXML);
tempBlob.DELETEALL;
tempBlob."Primay Key" := 1;
tempBlob.INSERT;
tempBlob.Blob.CREATEOUTSTREAM(outFile);
XMLInfoStoc.SETTABLEVIEW(Item);
XMLInfoStoc.SETDESTINATION(outFile);
XMLInfoStoc.EXPORT;
tempBlob.MODIFY;

tempBlob.CALCFIELDS(Blob);
IF tempBlob.Blob.HASVALUE THEN BEGIN
tempBlob.Blob.CREATEINSTREAM(Instr);
outXML.READ(Instr);
MESSAGE('Length= %1',FORMAT(outXML.LENGTH)); //the length of outXml is 582
outXML.GETSUBTEXT(TestText, 1, 1024) ; //outXml contains only characters ".<"
MESSAGE(TestText);
tempBlob.Blob.EXPORT('E:\simona\InfoStocOUTXML_cip2.xml') //the exporte file is ok, contains all required data in XML format
END;


WHY the OutXml is not containing all the data in Instr, as it is exported by tempBlob.Blob.EXPORT?????
It seems that the line outXML.READ(Instr) is not working properly, because the OutXml contains only ".<" instead of entire Instr...

Any idea, something missing??
I already compared with some exemples and seems that my code is ok... but is not...

Thank you in advance!
Simona

Best Answer

Answers

Sign In or Register to comment.