# SaxWriter.java

    /*
    ** Module   : SaxWriter
    ** Abstract : SAX writer specific interface.
    **
    ** Copyright (c) 2013-2017, Golden Code Development Corporation.
    **
    ** -#- -I- --Date-- ---------------------------------Description----------------------------------
    ** 001 EVL 20130208 Created initial version.
    ** 002 EVL 20130320 Adding SAX writer related literal constants.
    ** 003 EVK 20130903 Moved encoding methods to the new interface Encoding.
    ** 004 CA  20130927 Added LegacyResource annotation, to determine resource type.
    ** 005 EVL 20130911 Adding legacy attributes and methods annotation.
    ** 006 EVK 20131001 Added enum with 4gl writer status.
    */
    /*
    ** This program is free software: you can redistribute it and/or modify
    ** it under the terms of the GNU Affero General Public License as
    ** published by the Free Software Foundation, either version 3 of the
    ** License, or (at your option) any later version.
    **
    ** This program is distributed in the hope that it will be useful,
    ** but WITHOUT ANY WARRANTY; without even the implied warranty of
    ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    ** GNU Affero General Public License for more details.
    **
    ** You may find a copy of the GNU Affero GPL version 3 at the following
    ** location: https://www.gnu.org/licenses/agpl-3.0.en.html
    **
    ** Additional terms under GNU Affero GPL version 3 section 7:
    **
    **   Under Section 7 of the GNU Affero GPL version 3, the following additional
    **   terms apply to the works covered under the License.  These additional terms
    **   are non-permissive additional terms allowed under Section 7 of the GNU
    **   Affero GPL version 3 and may not be removed by you.
    **
    **   0. Attribution Requirement.
    **
    **     You must preserve all legal notices or author attributions in the covered
    **     work or Appropriate Legal Notices displayed by works containing the covered
    **     work.  You may not remove from the covered work any author or developer
    **     credit already included within the covered work.
    **
    **   1. No License To Use Trademarks.
    **
    **     This license does not grant any license or rights to use the trademarks
    **     Golden Code, FWD, any Golden Code or FWD logo, or any other trademarks
    **     of Golden Code Development Corporation. You are not authorized to use the
    **     name Golden Code, FWD, or the names of any author or contributor, for
    **     publicity purposes without written authorization.
    **
    **   2. No Misrepresentation of Affiliation.
    **
    **     You may not represent yourself as Golden Code Development Corporation or FWD.
    **
    **     You may not represent yourself for publicity purposes as associated with
    **     Golden Code Development Corporation, FWD, or any author or contributor to
    **     the covered work, without written authorization.
    **
    **   3. No Misrepresentation of Source or Origin.
    **
    **     You may not represent the covered work as solely your work.  All modified
    **     versions of the covered work must be marked in a reasonable way to make it
    **     clear that the modified work is not originating from Golden Code Development
    **     Corporation or FWD.  All modified versions must contain the notices of
    **     attribution required in this license.
    */

    package com.goldencode.p2j.xml;

    import com.goldencode.p2j.util.*;

    import java.util.EnumSet;

    /**
     * Interface describing SAX-Writer specific features of the SAX objects.
     */
    @LegacyResource(resource = LegacyResource.SAX_WRITER)
    public interface SaxWriter
    extends SaxEntity,
            Encoding
    {
       /**
        * The SAX-WRITE-IDLE constant returned by the PARSE-STATUS attribute, which in 4GL is the
        * integer value 1.
        */
       public static final int SAX_WRITE_IDLE = 1;

       /**
        * The SAX-WRITE-BEGIN constant returned by the PARSE-STATUS attribute, which in 4GL is the
        * integer value 2.
        */
       public static final int SAX_WRITE_BEGIN = 2;

       /**
        * The SAX-WRITE-TAG constant returned by the PARSE-STATUS attribute, which in 4GL is the
        * integer value 3.
        */
       public static final int SAX_WRITE_TAG = 3;

       /**
        * The SAX-WRITE-ELEMENT constant returned by the PARSE-STATUS attribute, which in 4GL is the
        * integer value 4.
        */
       public static final int SAX_WRITE_ELEMENT = 4;

       /**
        * The SAX-WRITE-CONTENT constant returned by the PARSE-STATUS attribute, which in 4GL is the
        * integer value 5.
        */
       public static final int SAX_WRITE_CONTENT = 5;

       /**
        * The SAX-WRITE-COMPLETE constant returned by the PARSE-STATUS attribute, which in 4GL is the
        * integer value 6.
        */
       public static final int SAX_WRITE_COMPLETE = 6;

       /**
        * The SAX-WRITE-ERROR constant returned by the PARSE-STATUS attribute, which in 4GL is the
        * integer value 7.
        */
       public static final int SAX_WRITE_ERROR = 7;

       /**
        * List of possible states of SAX-READER object, returned by the PARSE-STATUS attribute:
        * <ul>
        * <li>{@link #SAX_WRITE_IDLE} -The SAX-WRITE-IDLE constant which in 4GL is the integer
        * value 1.</li>
        * <li>{@link #SAX_WRITE_BEGIN} - The SAX-WRITE-BEGIN constant which in 4GL is the integer 2.
        * </li>
        * <li>{@link #SAX_WRITE_TAG} - The SAX-WRITE-TAG constant which in 4GL is the integer 3.</li>
        * <li>{@link #SAX_WRITE_ELEMENT} - SAX-WRITE-ELEMENT constant which in 4GL is the integer 4.
        * </li>
        * <li>{@link #SAX_WRITE_CONTENT} - The SAX-WRITE-CONTENT constant which in 4GL is the
        * integer 5.</li>
        * <li>{@link #SAX_WRITE_COMPLETE} - The SAX-WRITE-COMPLETE constant which in 4GL is the
        * integer 6.</li>
        * <li>{@link #SAX_WRITE_ERROR} - The SAX-WRITE-ERROR constant which in 4GL is the integer 7.
        * </li>
        * </ul>
        */
       enum WriteStatus
       {
          SAX_WRITE_IDLE    (1, "SAX-WRITE-IDLE"),
          SAX_WRITE_BEGIN   (2, "SAX-WRITE-BEGIN"),
          SAX_WRITE_TAG     (3, "SAX-WRITE-TAG"),
          SAX_WRITE_ELEMENT (4, "SAX-WRITE-ELEMENT"),
          SAX_WRITE_CONTENT (5, "SAX-WRITE-CONTENT"),
          SAX_WRITE_COMPLETE(6, "SAX-WRITE-COMPLETE"),
          SAX_WRITE_ERROR   (7, "SAX-WRITE-ERROR");

          /** Non writable statuses.*/
          static final EnumSet<WriteStatus> nonWritableStatuses = EnumSet.of(SAX_WRITE_IDLE,
                                                                             SAX_WRITE_COMPLETE);

          /** Writable statuses.*/
          static final EnumSet<WriteStatus> writableStatuses = EnumSet.of(SAX_WRITE_BEGIN,
                                                                          SAX_WRITE_TAG,
                                                                          SAX_WRITE_ELEMENT,
                                                                          SAX_WRITE_CONTENT);

          /** Status while writing body of element node.*/
          static final EnumSet<WriteStatus> writableBodyStatuses = EnumSet.of(SAX_WRITE_TAG);

          /** 4gl constant value */
          private final int status;

          /** 4gl constant name */
          private final String name;

          /**
           * Constructor to define status of sax-writer
           *
           * @param    status
           *           integer value of sax-writer status in 4gl.
           * @param    name
           *           String representation of sax-writer status in 4gl.
           */
          WriteStatus(int status, String name)
          {
             this.status = status;
             this.name = name;
          }

          /**
           * Returns the 4gl name of this enum constant.
           *
           * @return See above.
           */
          public String getName()
          {
             return name;
          }

          /**
           * Returns the 4gl value of this enum constant.
           *
           * @return See above.
           */
          public int getStatus()
          {
             return status;
          }

          /**
           * Returns the name of this enum constant, as contained in the
           * declaration.  This method may be overridden, though it typically
           * isn't necessary or desirable.  An enum type should override this
           * method when a more "programmer-friendly" string form exists.
           *
           * @return the name of this enum constant
           */
          @Override
          public String toString()
          {
             return name;
          }
       }

       /**
        * Gets the value of the formatted attribute for the given SAX-Writer object. Formatted means
        * extra space or carrage returns should be added to preserve the hierarchical view of the
        * document.
        *
        * @return   The <code>true</code> in case of formatted <code>false</code> otherwise.
        */
       @LegacyAttribute(name = "FORMATTED")
       public logical getFormatted();

       /**
        * Sets the value of the formatted attribute for the given SAX-Writer object. Formatted means
        * extra space or carrage returns should be added to preserve the hierarchical view of the
        * document.
        *
        * @param    isFormatted
        *           The <code>true</code> in case of formatted <code>false</code> otherwise.
        */
       @LegacyAttribute(name = "FORMATTED", setter = true)
       public void setFormatted(logical isFormatted);

       /**
        * Sets the value of the formatted attribute for the given SAX-Writer object. Formatted means
        * extra space or carrage returns should be added to preserve the hierarchical view of the
        * document.
        *
        * @param    isFormatted
        *           The <code>true</code> in case of formatted <code>false</code> otherwise.
        */
       @LegacyAttribute(name = "FORMATTED", setter = true)
       public void setFormatted(boolean isFormatted);

       /**
        * Gets the value of the strict attribute for the given SAX-Writer object. Strict means
        * SAX-Writer should make well formed XML document. The default is true.
        *
        * @return   The <code>true</code> in case of strict <code>false</code> otherwise.
        */
       @LegacyAttribute(name = "STRICT")
       public logical getStrict();

       /**
        * Sets the value of the strict attribute for the given SAX-Writer object. Strict means
        * SAX-Writer should make well formed XML document. The default is true.
        *
        * @param    isStrict
        *           The <code>true</code> in case of strict <code>false</code> otherwise.
        */
       @LegacyAttribute(name = "STRICT", setter = true)
       public void setStrict(logical isStrict);

       /**
        * Sets the value of the strict attribute for the given SAX-Writer object. Strict means
        * SAX-Writer should make well formed XML document. The default is true.
        *
        * @param    isStrict
        *           The <code>true</code> in case of strict <code>false</code> otherwise.
        */
       @LegacyAttribute(name = "STRICT", setter = true)
       public void setStrict(boolean isStrict);

       /**
        * Gets the value of the fragment attribute for the given SAX-Writer object. Fragment means
        * SAX-Writer output is part of the document or full.
        *
        * @return   The <code>true</code> in case of fragment <code>false</code> for full document.
        */
       @LegacyAttribute(name = "FRAGMENT")
       public logical getFragment();

       /**
        * Sets the value of the fragment attribute for the given SAX-Writer object. Fragment means
        * SAX-Writer output is part of the document or full.
        *
        * @param    isFragment
        *           The <code>true</code> in case of fragment <code>false</code> for full document.
        */
       @LegacyAttribute(name = "FRAGMENT", setter = true)
       public void setFragment(logical isFragment);

       /**
        * Sets the value of the fragment attribute for the given SAX-Writer object. Fragment means
        * SAX-Writer output is part of the document or full.
        *
        * @param    isFragment
        *           The <code>true</code> in case of fragment <code>false</code> for full document.
        */
       @LegacyAttribute(name = "FRAGMENT", setter = true)
       public void setFragment(boolean isFragment);

       /**
        * Gets the value of the standalone attribute for the given SAX-Writer object.
        *
        * @return   The character value of the standalone attribute.
        */
       @LegacyAttribute(name = "STANDALONE")
       public logical getStandalone();

       /**
        * Sets the value of the standalone attribute for the given SAX-Writer object.
        *
        * @param    isStandalone
        *           The <code>true</code> in case of standalone <code>false</code> otherwise.
        */
       @LegacyAttribute(name = "STANDALONE", setter = true)
       public void setStandalone(logical isStandalone);

       /**
        * Sets the value of the standalone attribute for the given SAX-Writer object.
        *
        * @param    isStandalone
        *           The <code>true</code> in case of standalone <code>false</code> otherwise.
        */
       @LegacyAttribute(name = "STANDALONE", setter = true)
       public void setStandalone(boolean isStandalone);

       /**
        * Gets the value of the version attribute for the given SAX-Writer object.
        *
        * @return   The character value of the version attribute.
        */
       @LegacyAttribute(name = "VERSION")
       public character getVersion();

       /**
        * Sets the new value of the version attribute for the given SAX-Writer object.
        *
        * @param    version
        *           The version value to be set for the given writer.
        */
       @LegacyAttribute(name = "VERSION", setter = true)
       public void setVersion(String version);

       /**
        * Sets the new value of the version attribute for the given SAX-Writer object.
        *
        * @param    version
        *           The version value to be set for the given writer.
        */
       @LegacyAttribute(name = "VERSION", setter = true)
       public void setVersion(character version);

       /**
        * Gets the value of the write-status attribute for the given SAX-Writer object. This is one
        * of the SAX_WRITE_* constants defined by the {@link SaxWriter} interface.
        * <p>
        * Documentation states that the type of this attribute is character, but this is incorrect.
        * The attribute's real type is integer, same as PARSE-STATUS for the SAX-Reader object.
        *
        * @return   The integer value of the write-status attribute.
        */
       @LegacyAttribute(name = "WRITE-STATUS")
       public integer getWriteStatus();

       /**
        * Adds namespace declaration to a tag in a XML document associated with SAX-Writer object.
        *
        * @param    uri
        *           The URI namespace to add.
        * @param    prefix
        *           The prefix of the namespace to add.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "DECLARE-NAMESPACE")
       public logical declareNamespace(Text uri, Text prefix);

       /**
        * Adds namespace declaration to a tag in a XML document associated with SAX-Writer object.
        *
        * @param    uri
        *           The URI namespace to add.
        * @param    prefix
        *           The prefix of the namespace to add.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "DECLARE-NAMESPACE")
       public logical declareNamespace(String uri, Text prefix);

       /**
        * Adds namespace declaration to a tag in a XML document associated with SAX-Writer object.
        *
        * @param    uri
        *           The URI namespace to add.
        * @param    prefix
        *           The prefix of the namespace to add.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "DECLARE-NAMESPACE")
       public logical declareNamespace(Text uri, String prefix);

       /**
        * Adds namespace declaration to a tag in a XML document associated with SAX-Writer object.
        *
        * @param    uri
        *           The URI namespace to add.
        * @param    prefix
        *           The prefix of the namespace to add.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "DECLARE-NAMESPACE")
       public logical declareNamespace(String uri, String prefix);

       /**
        * Adds namespace declaration to a tag in a XML document associated with SAX-Writer object.
        *
        * @param    uri
        *           The URI namespace to add.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "DECLARE-NAMESPACE")
       public logical declareNamespace(String uri);

       /**
        * Adds namespace declaration to a tag in a XML document associated with SAX-Writer object.
        *
        * @param    uri
        *           The URI namespace to add.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "DECLARE-NAMESPACE")
       public logical declareNamespace(Text uri);

       /**
        * Closes the XML document associated with SAX-Writer object.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "END-DOCUMENT")
       public logical endDocument();

       /**
        * Ends an XML node of the given name in a XML document associated with SAX-Writer object.
        *
        * @param    name
        *           The name of the node to end.
        * @param    uri
        *           The URI namespace of the node to end.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "END-ELEMENT")
       public logical endElement(Text name, Text uri);

       /**
        * Ends an XML node of the given name in a XML document associated with SAX-Writer object.
        *
        * @param    name
        *           The name of the node to end.
        * @param    uri
        *           The URI namespace of the node to end.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "END-ELEMENT")
       public logical endElement(String name, Text uri);

       /**
        * Ends an XML node of the given name in a XML document associated with SAX-Writer object.
        *
        * @param    name
        *           The name of the node to end.
        * @param    uri
        *           The URI namespace of the node to end.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "END-ELEMENT")
       public logical endElement(Text name, String uri);

       /**
        * Ends an XML node of the given name in a XML document associated with SAX-Writer object.
        *
        * @param    name
        *           The name of the node to end.
        * @param    uri
        *           The URI namespace of the node to end.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "END-ELEMENT")
       public logical endElement(String name, String uri);

       /**
        * Ends an XML node of the given name in a XML document associated with SAX-Writer object.
        *
        * @param    name
        *           The name of the node to end.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "END-ELEMENT")
       public logical endElement(String name);

       /**
        * Ends an XML node of the given name in a XML document associated with SAX-Writer object.
        *
        * @param    name
        *           The name of the node to end.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "END-ELEMENT")
       public logical endElement(Text name);

       /**
        * Specifies the output destination of the XML document to be created by a SAX-Writer object.
        *
        * @param    mode
        *           The type of the destination to write to. Can be 'FILE', 'STREAM', 'MEMPTR',
        *           'STREAM-HANDLE' or 'LONGCHAR'.
        * @param    destination
        *           The appropriate object to write.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "SET-OUTPUT-DESTINATION")
       public logical setOutputDestination(String mode, Object destination);

       /**
        * Specifies the output destination of the XML document to be created by a SAX-Writer object.
        *
        * @param    mode
        *           The type of the destination to write to. Can be 'FILE', 'STREAM', 'MEMPTR',
        *           'STREAM-HANDLE' or 'LONGCHAR'.
        * @param    destination
        *           The appropriate object to write.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "SET-OUTPUT-DESTINATION")
       public logical setOutputDestination(character mode, Object destination);

       /**
        * Creates the XML document with the prolog information.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "START-DOCUMENT")
       public logical startDocument();

       /**
        * Starts the XML node according to the specified name, namespace URI and handle of the SAX
        * attribute object.
        *
        * @param    name
        *           The name of the element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "START-ELEMENT")
       public logical startElement(Text name);

       /**
        * Starts the XML node according to the specified name, namespace URI and handle of the SAX
        * attribute object.
        *
        * @param    name
        *           The name of the element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "START-ELEMENT")
       public logical startElement(String name);

       /**
        * Starts the XML node according to the specified name, namespace URI and handle of the SAX
        * attribute object.
        *
        * @param    name
        *           The name of the element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "START-ELEMENT")
       public logical startElement(Text name, handle handle);

       /**
        * Starts the XML node according to the specified name, namespace URI and handle of the SAX
        * attribute object.
        *
        * @param    name
        *           The name of the element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "START-ELEMENT")
       public logical startElement(String name, handle handle);

       /**
        * Starts the XML node according to the specified name, namespace URI and handle of the SAX
        * attribute object.
        *
        * @param    name
        *           The name of the element.
        * @param    uri
        *           The namespace URI of the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "START-ELEMENT")
       public logical startElement(Text name, Text uri);

       /**
        * Starts the XML node according to the specified name, namespace URI and handle of the SAX
        * attribute object.
        *
        * @param    name
        *           The name of the element.
        * @param    uri
        *           The namespace URI of the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "START-ELEMENT")
       public logical startElement(String name, Text uri);

       /**
        * Starts the XML node according to the specified name, namespace URI and handle of the SAX
        * attribute object.
        *
        * @param    name
        *           The name of the element.
        * @param    uri
        *           The namespace URI of the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "START-ELEMENT")
       public logical startElement(Text name, String uri);

       /**
        * Starts the XML node according to the specified name, namespace URI and handle of the SAX
        * attribute object.
        *
        * @param    name
        *           The name of the element.
        * @param    uri
        *           The namespace URI of the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "START-ELEMENT")
       public logical startElement(String name, String uri);

       /**
        * Starts the XML node according to the specified name, namespace URI and handle of the SAX
        * attribute object.
        *
        * @param    name
        *           The name of the element.
        * @param    uri
        *           The namespace URI of the given element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "START-ELEMENT")
       public logical startElement(String name, Text uri, handle handle);

       /**
        * Starts the XML node according to the specified name, namespace URI and handle of the SAX
        * attribute object.
        *
        * @param    name
        *           The name of the element.
        * @param    uri
        *           The namespace URI of the given element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "START-ELEMENT")
       public logical startElement(Text name, String uri, handle handle);

       /**
        * Starts the XML node according to the specified name, namespace URI and handle of the SAX
        * attribute object.
        *
        * @param    name
        *           The name of the element.
        * @param    uri
        *           The namespace URI of the given element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "START-ELEMENT")
       public logical startElement(String name, String uri, handle handle);

       /**
        * Starts the XML node according to the specified name, namespace URI and handle of the SAX
        * attribute object.
        *
        * @param    name
        *           The name of the element.
        * @param    uri
        *           The namespace URI of the given element.
        * @param    attr
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "START-ELEMENT")
       public logical startElement(Text name, Text uri, handle attr);

       /**
        * Adds CDATA block to the XML document crating by SAX-Writer object.
        *
        * @param    cdataBlock
        *           The data to be written with CDATA block.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-CDATA")
       public logical writeCdata(Text cdataBlock);

       /**
        * Adds CDATA block to the XML document crating by SAX-Writer object.
        *
        * @param    cdataBlock
        *           The data to be written with CDATA block.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-CDATA")
       public logical writeCdata(String cdataBlock);

       /**
        * Adds character data to the XML document crating by SAX-Writer object.
        *
        * @param    chardata
        *           The character or longchar data to be written.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-CHARACTERS")
       public logical writeCharacters(Text chardata);

       /**
        * Adds character data to the XML document crating by SAX-Writer object.
        *
        * @param    chardata
        *           The character or longchar data to be written.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-CHARACTERS")
       public logical writeCharacters(String chardata);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(Text name, Text chardata);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(String name, Text chardata);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(Text name, String chardata);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(String name, String chardata);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(Text name, Text chardata, Text uri);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(String name, Text chardata, Text uri);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(Text name, String chardata, Text uri);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(String name, String chardata, Text uri);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(Text name, Text chardata, String uri);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(String name, Text chardata, String uri);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(Text name, String chardata, String uri);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(String name, String chardata, String uri);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(Text name, Text chardata, handle handle);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(String name, Text chardata, handle handle);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(Text name, String chardata, handle handle);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(String name, String chardata, handle handle);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(Text name, Text chardata, String uri, handle handle);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(String name, Text chardata, Text uri, handle handle);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(Text name, String chardata, Text uri, handle handle);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(String name, String chardata, Text uri, handle handle);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(String name, Text chardata, String uri, handle handle);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(Text name, String chardata, String uri, handle handle);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(String name, String chardata, String uri,
                                       handle handle);

       /**
        * Creates complete XML node with a given SAX-Writer object.
        *
        * @param    name
        *           The name of the element.
        * @param    chardata
        *           The XML text to write for the given element.
        * @param    uri
        *           The namespace URI of the given element.
        * @param    handle
        *           The handle of the SAX-Attribute object to be added into XML document.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-DATA-ELEMENT")
       public logical writeDataElement(Text name, Text chardata, Text uri,
                                       handle handle);

       /**
        * Adds character data to the XML document crating by SAX-Writer object.
        *
        * @param    chardata
        *           The character or longchar data to be written.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-FRAGMENT")
       public logical writeFragment(Text chardata);

       /**
        * Adds character data to the XML document crating by SAX-Writer object.
        *
        * @param    chardata
        *           The character or longchar data to be written.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-FRAGMENT")
       public logical writeFragment(String chardata);

       /**
        * Adds character data to the XML document crating by SAX-Writer object.
        *
        * @param    xhandle
        *           The valid X-Nodereference handle containing XML text.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-FRAGMENT")
       public logical writeFragment(handle xhandle);

       /**
        * Closes the open stream and resets the SAX-Writer object to the default state.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "RESET")
       public logical reset();

       /**
        * Adds comment to the XML document crating by SAX-Writer object.
        *
        * @param    comment
        *           The character or longchar text comment to be written.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-COMMENT")
       public logical writeComment(Text comment);

       /**
        * Adds comment to the XML document crating by SAX-Writer object.
        *
        * @param    comment
        *           The character or longchar text comment to be written.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-COMMENT")
       public logical writeComment(String comment);

       /**
        * Creates an empty node in a given SAX-Writer object.
        *
        * @param    name
        *           The character or longchar element name to be written.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EMPTY-ELEMENT")
       public logical writeEmptyElement(Text name);

       /**
        * Creates an empty node in a given SAX-Writer object.
        *
        * @param    name
        *           The character or longchar element name to be written.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EMPTY-ELEMENT")
       public logical writeEmptyElement(String name);

       /**
        * Creates an empty node in a given SAX-Writer object.
        *
        * @param    name
        *           The character or longchar element name to be written.
        * @param    uri
        *           The character or longchar element URI to be written.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EMPTY-ELEMENT")
       public logical writeEmptyElement(Text name, Text uri);

       /**
        * Creates an empty node in a given SAX-Writer object.
        *
        * @param    name
        *           The character or longchar element name to be written.
        * @param    uri
        *           The character or longchar element URI to be written.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EMPTY-ELEMENT")
       public logical writeEmptyElement(String name, Text uri);

       /**
        * Creates an empty node in a given SAX-Writer object.
        *
        * @param    name
        *           The character or longchar element name to be written.
        * @param    uri
        *           The character or longchar element URI to be written.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EMPTY-ELEMENT")
       public logical writeEmptyElement(Text name, String uri);

       /**
        * Creates an empty node in a given SAX-Writer object.
        *
        * @param    name
        *           The character or longchar element name to be written.
        * @param    uri
        *           The character or longchar element URI to be written.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EMPTY-ELEMENT")
       public logical writeEmptyElement(String name, String uri);

       /**
        * Creates an empty node in a given SAX-Writer object.
        *
        * @param    name
        *           The character or longchar element name to be written.
        * @param    attr
        *           The handle of the SAX-Attributes object to be used.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EMPTY-ELEMENT")
       public logical writeEmptyElement(Text name, handle attr);

       /**
        * Creates an empty node in a given SAX-Writer object.
        *
        * @param    name
        *           The character or longchar element name to be written.
        * @param    attr
        *           The handle of the SAX-Attributes object to be used.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EMPTY-ELEMENT")
       public logical writeEmptyElement(String name, handle attr);

       /**
        * Creates an empty node in a given SAX-Writer object.
        *
        * @param    name
        *           The character or longchar element name to be written.
        * @param    uri
        *           The character or longchar element URI to be written.
        * @param    attr
        *           The handle of the SAX-Attributes object to be used.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EMPTY-ELEMENT")
       public logical writeEmptyElement(String name, Text uri, handle attr);

       /**
        * Creates an empty node in a given SAX-Writer object.
        *
        * @param    name
        *           The character or longchar element name to be written.
        * @param    uri
        *           The character or longchar element URI to be written.
        * @param    attr
        *           The handle of the SAX-Attributes object to be used.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EMPTY-ELEMENT")
       public logical writeEmptyElement(Text name, String uri, handle attr);

       /**
        * Creates an empty node in a given SAX-Writer object.
        *
        * @param    name
        *           The character or longchar element name to be written.
        * @param    uri
        *           The character or longchar element URI to be written.
        * @param    attr
        *           The handle of the SAX-Attributes object to be used.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EMPTY-ELEMENT")
       public logical writeEmptyElement(String name, String uri, handle attr);

       /**
        * Creates an empty node in a given SAX-Writer object.
        *
        * @param    name
        *           The character or longchar element name to be written.
        * @param    uri
        *           The character or longchar element URI to be written.
        * @param    attr
        *           The handle of the SAX-Attributes object to be used.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EMPTY-ELEMENT")
       public logical writeEmptyElement(Text name, Text uri, handle attr);

       /**
        * Adds an entity referenc to the XML document associated with given SAX-Writer object.
        *
        * @param    value
        *           The character or longchar value to be written.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-ENTITY-REF")
       public logical writeEntityRef(Text value);

       /**
        * Adds an entity referenc to the XML document associated with given SAX-Writer object.
        *
        * @param    value
        *           The character or longchar value to be written.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-ENTITY-REF")
       public logical writeEntityRef(String value);

       /**
        * Adds an external DTD reference to the XML document associated with a SAX-Writer object.
        *
        * @param    name
        *           The character or longchar name of the document root node.
        * @param    systemId
        *           The character or longchar system ID of the DTD.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EXTERNAL-DTD")
       public logical writeExternalDtd(Text name, Text systemId);

       /**
        * Adds an external DTD reference to the XML document associated with a SAX-Writer object.
        *
        * @param    name
        *           The character or longchar name of the document root node.
        * @param    systemId
        *           The character or longchar system ID of the DTD.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EXTERNAL-DTD")
       public logical writeExternalDtd(String name, Text systemId);

       /**
        * Adds an external DTD reference to the XML document associated with a SAX-Writer object.
        *
        * @param    name
        *           The character or longchar name of the document root node.
        * @param    systemId
        *           The character or longchar system ID of the DTD.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EXTERNAL-DTD")
       public logical writeExternalDtd(Text name, String systemId);

       /**
        * Adds an external DTD reference to the XML document associated with a SAX-Writer object.
        *
        * @param    name
        *           The character or longchar name of the document root node.
        * @param    systemId
        *           The character or longchar system ID of the DTD.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EXTERNAL-DTD")
       public logical writeExternalDtd(String name, String systemId);

       /**
        * Adds an external DTD reference to the XML document associated with a SAX-Writer object.
        *
        * @param    name
        *           The character or longchar name of the document root node.
        * @param    systemId
        *           The character or longchar system ID of the DTD.
        * @param    publicId
        *           The character or longchar public ID of the DTD.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EXTERNAL-DTD")
       public logical writeExternalDtd(String name, Text systemId, Text publicId);

       /**
        * Adds an external DTD reference to the XML document associated with a SAX-Writer object.
        *
        * @param    name
        *           The character or longchar name of the document root node.
        * @param    systemId
        *           The character or longchar system ID of the DTD.
        * @param    publicId
        *           The character or longchar public ID of the DTD.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EXTERNAL-DTD")
       public logical writeExternalDtd(Text name, String systemId, Text publicId);

       /**
        * Adds an external DTD reference to the XML document associated with a SAX-Writer object.
        *
        * @param    name
        *           The character or longchar name of the document root node.
        * @param    systemId
        *           The character or longchar system ID of the DTD.
        * @param    publicId
        *           The character or longchar public ID of the DTD.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EXTERNAL-DTD")
       public logical writeExternalDtd(String name, String systemId, Text publicId);

       /**
        * Adds an external DTD reference to the XML document associated with a SAX-Writer object.
        *
        * @param    name
        *           The character or longchar name of the document root node.
        * @param    systemId
        *           The character or longchar system ID of the DTD.
        * @param    publicId
        *           The character or longchar public ID of the DTD.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EXTERNAL-DTD")
       public logical writeExternalDtd(Text name, Text systemId, String publicId);

       /**
        * Adds an external DTD reference to the XML document associated with a SAX-Writer object.
        *
        * @param    name
        *           The character or longchar name of the document root node.
        * @param    systemId
        *           The character or longchar system ID of the DTD.
        * @param    publicId
        *           The character or longchar public ID of the DTD.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EXTERNAL-DTD")
       public logical writeExternalDtd(String name, Text systemId, String publicId);

       /**
        * Adds an external DTD reference to the XML document associated with a SAX-Writer object.
        *
        * @param    name
        *           The character or longchar name of the document root node.
        * @param    systemId
        *           The character or longchar system ID of the DTD.
        * @param    publicId
        *           The character or longchar public ID of the DTD.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EXTERNAL-DTD")
       public logical writeExternalDtd(Text name, String systemId, String publicId);

       /**
        * Adds an external DTD reference to the XML document associated with a SAX-Writer object.
        *
        * @param    name
        *           The character or longchar name of the document root node.
        * @param    systemId
        *           The character or longchar system ID of the DTD.
        * @param    publicId
        *           The character or longchar public ID of the DTD.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EXTERNAL-DTD")
       public logical writeExternalDtd(String name, String systemId, String publicId);

       /**
        * Adds an external DTD reference to the XML document associated with a SAX-Writer object.
        *
        * @param    name
        *           The character or longchar name of the document root node.
        * @param    systemId
        *           The character or longchar system ID of the DTD.
        * @param    publicId
        *           The character or longchar public ID of the DTD.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-EXTERNAL-DTD")
       public logical writeExternalDtd(Text name, Text systemId, Text publicId);

       /**
        * Creates a processing instruction node in XML document for given SAX-Writer object.
        *
        * @param    target
        *           The character or longchar target of the processing instruction.
        * @param    data
        *           The character or longchar data associated with the processing instruction.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-PROCESSING-INSTRUCTION")
       public logical writeProcessingInstruction(String target, Text data);

       /**
        * Creates a processing instruction node in XML document for given SAX-Writer object.
        *
        * @param    target
        *           The character or longchar target of the processing instruction.
        * @param    data
        *           The character or longchar data associated with the processing instruction.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-PROCESSING-INSTRUCTION")
       public logical writeProcessingInstruction(Text target, String data);

       /**
        * Creates a processing instruction node in XML document for given SAX-Writer object.
        *
        * @param    target
        *           The character or longchar target of the processing instruction.
        * @param    data
        *           The character or longchar data associated with the processing instruction.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-PROCESSING-INSTRUCTION")
       public logical writeProcessingInstruction(String target, String data);

       /**
        * Creates a processing instruction node in XML document for given SAX-Writer object.
        *
        * @param    target
        *           The character or longchar target of the processing instruction.
        * @param    data
        *           The character or longchar data associated with the processing instruction.
        *
        * @return   The <code>true</code> in case of success <code>false</code> otherwise.
        */
       @LegacyMethod(name = "WRITE-PROCESSING-INSTRUCTION")
       public logical writeProcessingInstruction(Text target, Text data);
    }