xml.StaxWriter.attribute

Writes an XML attribute to the StaxWriter stream.

Syntax

attribute(
   name STRING,
   value STRING )
  1. name is the local name of the XML attribute. It cannot be NULL.
  2. value is the value of the XML attribute. It cannot be NULL.

Usage

Attributes can only be written on the StaxWriter stream if it points to a START_ELEMENT or an EMPTY_ELEMENT, otherwise the operation fails with an exception; that is, this method can only be called after a startElement, startElementNS, emptyElement, emptyElementNS, or attribute and attributeNS.

In case of error, the method throws an exception and sets the STATUS variable. Depending on the error, a human-readable description of the problem is available in the SQLCA.SQLERRM register. See Error handling in GWS calls (STATUS).