xml.StaxWriter.declareNamespace

Binds a namespace URI to a prefix, and forces the output of the XML namespace definition to the StaxWriter stream.

Syntax

declareNamespace(
   prefix STRING,
   ns STRING )
  1. prefix is the prefix to be bind to the URI, cannot be NULL.
  2. ns is the URI to bind to the default namespace, cannot be NULL.

Usage

The stream must point to a START_ELEMENT, and the prefix scope is the current START_ELEMENT / END_ELEMENT pair.

In case of error, the method throws an exception and sets the STATUS variable with the appropriate error number.