-- $Date: 2004/01/28 05:10:09 $
-- $Revision: 1.9 $
-- $Author: jcrocholl $

with Ada.Unchecked_Deallocation;

-- Light-weight XML output file writers.
package body XML_Writers is

   -------------------
   -- Creating writers
   -------------------

   -- Create an XML writer for current output (stdout).
   function Current_Output
     return XML_Writer_Access -- The newly created XML writer instance.
   is
      Result : XML_Writer_Access := new XML_Writer;
   begin
      Initialize(Result);
      return Result;
   end Current_Output;

   -- Create an XML writer for file output.
   function Create
     (Filename : in String)   -- Open this file.
     return XML_Writer_Access -- The newly created XML writer instance.
   is
      Result : XML_Writer_Access := new XML_Writer;
   begin
      Initialize(Result, Filename);
      return Result;
   end Create;