Kbase P8379: 4GL/ABL: How to append text at the end of a text file?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  08/06/2009 |
|
Status: Verified
GOAL:
4GL/ABL: How to append text at the end of a text file?
GOAL:
How to append text at the end of an XML file?
GOAL:
Is there a way to use the x-document and x-noderef objects to add newlines to the very end of an XML file?
FACT(s) (Environment):
All Supported Operating Systems
Progress 9.x
OpenEdge 10.x
FIX:
There is no x-document or x-noderef method to add additional text after the end of the XML document object. The only way to do that is to use the APPEND option of the OUTPUT TO statement. For example the following code appends a new line character at the end of an existing XML file and appends some text after that new line:
OUTPUT TO VALUE ("cust.xml") APPEND.
/* Append a new line character to the end of the file */
PUT UNFORMATTED "~n ".
/* Append some text after the new line character */
PUT UNFORMATTED "this is the appended text".
OUTPUT CLOSE.