xml.StaxWriter methods

Methods for the xml.StaxWriter class.

Table 1. Class methods: Creation
Name Description
xml.StaxWriter.create()
  RETURNING object xml.StaxWriter
Constructor of a StaxWriter object.
Table 2. Object methods: Configuration
Name Description
getFeature(
   feature STRING )
  RETURNING str STRING
Gets a feature of a StaxWriter object.
setFeature(
   feature STRING,
   value STRING )
Sets a feature of a StaxWriter object.
Table 3. Object methods: Output
Name Description
close()
Closes the StaxWriter streaming, and releases all associated resources.
writeTo(
   url STRING )
Sets the output stream of the StaxWriter object to a file or an URL, and starts the streaming.
writeToDocument(
   doc xml.DomDocument )
Sets the output stream of the StaxWriter object to an xml.DomDocument object, and starts the streaming.
writeToPipe(
   cmd STRING )
Sets the output stream of the StaxWriter object to a PIPE, and starts the streaming.
writeToText(
   txt TEXT )
Sets the output stream of the StaxWriter object to a TEXT large object, and starts the streaming.
Table 4. Object methods: Document
Name Description
dtd(
   data STRING )
Writes a DTD to the StaxWriter stream.
endDocument()
Closes any open tags and writes corresponding end tags.
startDocument(
   encoding STRING,
   version STRING,
   standalone INTEGER )
Writes an XML declaration to the StaxWriter stream.
Table 5. Object methods: Namespace
Name Description
declareDefaultNamespace(
   defaultNS STRING )
Binds a namespace URI to the default namespace, and forces the output of the default XML namespace definition to the StaxWriter stream.
declareNamespace(
   prefix STRING,
   ns STRING )
Binds a namespace URI to a prefix, and forces the output of the XML namespace definition to the StaxWriter stream.
setDefaultNamespace(
   defaultNS STRING )
Binds a namespace URI to the default namespace.
setPrefix(
   prefix STRING,
   ns STRING )
Binds a namespace URI to a prefix.
Table 6. Object methods: Node
Name Description
attribute(
   name STRING,
   value STRING )
Writes an XML attribute to the StaxWriter stream.
attributeNS(
   name STRING,
   ns STRING,
   value STRING )
Writes an XML namespace qualified attribute to the StaxWriter stream.
cdata(
   data STRING )
Writes an XML CData to the StaxWriter stream.
characters(
   text STRING )
Writes an XML text to the StaxWriter stream.
comment(
   data STRING )
Writes an XML comment to the StaxWriter stream.
emptyElement(
   name STRING )
Writes an empty XML element to the StaxWriter stream.
emptyElementNS(
   name STRING,
   ns STRING )
Writes an empty namespace qualified XML element to the StaxWriter stream.
endElement()
Writes an end tag to the StaxWriter stream relying on the internal state to determine the prefix and local name of the last START_ELEMENT.
entityRef(
   name STRING )
Writes an XML EntityReference to the StaxWriter stream.
processingInstruction(
   target STRING,
   data STRING )
Writes an XML ProcessingInstruction to the StaxWriter stream
startElement(
   name STRING )
Writes an XML start element to the StaxWriter stream.
startElementNS(
   name STRING,
   ns STRING )
Writes a namespace-qualified XML start element to the StaxWriter stream.