xml.StaxReader methods

Methods for the xml.StaxReader class.

Table 1. Class methods: Creation
Name Description
xml.StaxReader.Create()
  RETURNING object xml.StaxReader
Constructor of a StaxReader object.
Table 2. Object methods: Configuration
Name Description
setFeature(
   feature STRING,
   value STRING )
Sets a feature of a StaxReader object.
getFeature(
   feature STRING )
  RETURNING str STRING
Gets a feature of a StaxReader object.
Table 3. Object methods: Input
Name Description
readFrom(
   url STRING )
Sets the input stream of the StaxReader object to a file or an URL and starts the streaming
readFromDocument(
   doc xml.DomDocument )
Sets the input stream of the StaxReader object to a DomDocument object and starts the streaming
readFromText(
   txt TEXT )
Sets the input stream of the StaxReader object to a TEXT large object and starts the streaming.
readFromPipe(
   cmd STRING )
Sets the input stream of the StaxReader object to a PIPE and starts the streaming.
close()
Closes the StaxReader streaming and releases all associated resources.
Table 4. Object methods: Access
Name Description
getEventType()
  RETURNING eventtype STRING
Returns a string that indicates the type of event the cursor of the StaxReader object is pointing to.
hasName()
  RETURNING flag INTEGER
Checks whether the StaxReader cursor points to a node with a name.
hasText()
  RETURNING flag INTEGER
Checks whether the StaxReader cursor points to a node with a text value.
isEmptyElement()
  RETURNING flag INTEGER
Checks whether the StaxReader cursor points to an empty element node.
isStartElement()
  RETURNING flag INTEGER
Checks whether the StaxReader cursor points to a start element node.
isEndElement()
  RETURNING flag INTEGER
Checks whether the StaxReader cursor points to an end element node.
isCharacters()
  RETURNING flag INTEGER
Checks whether the StaxReader cursor points to a text node.
isIgnorableWhitespace()
  RETURNING flag INTEGER
Checks whether the StaxReader cursor points to ignorable whitespace.
Table 5. Object methods: Document
Name Description
getEncoding()
  RETURNING docenc STRING
Returns the document encoding defined in the XML Document declaration, or NULL.
getVersion()
  RETURNING version STRING
Returns the document version defined in the XML Document declaration, or NULL.
isStandalone()
  RETURNING flag STRING
Checks whether the document standalone attribute defined in the XML Document declaration is set to yes.
standaloneSet()
  RETURNING flag STRING
Checks whether the document standalone attribute is defined in the XML Document declaration.
Table 6. Object methods: Nodes
Name Description
getPrefix()
  RETURNING prefix STRING
Returns the prefix of the current XML node, or NULL.
getLocalName()
  RETURNING localname STRING
Returns the local name of the current XML node, or NULL.
getName()
  RETURNING name STRING
Returns the qualified name of the current XML node, or NULL.
getNamespace()
  RETURNING nsuri STRING
Returns the namespace URI of the current XML node, or NULL.
getText()
  RETURNING value STRING
Returns as a string the value of the current XML node, or NULL.
Table 7. Object methods: Processing Instructions
Name Description
getPITarget()
  RETURNING target STRING
Returns the target part of an XML ProcessingInstruction node, or NULL.
getPIData()
  RETURNING data STRING
Returns the data part of an XML ProcessingInstruction node, or NULL.
Table 8. Object methods: Attributes
Name Description
getAttributeCount()
  RETURNING num INTEGER
Returns the number of XML attributes defined on the current XML node, or zero.
getAttributeLocalName(
   pos INTEGER )
  RETURNING localname STRING
Returns the local name of an XML attribute defined at a given position on the current XML node, or NULL.
getAttributeNamespace(
   pos INTEGER )
  RETURNING nsuri STRING
Returns the namespace URI of an XML attribute defined at a given position on the current XML node, or NULL.
getAttributePrefix(
   pos INTEGER )
  RETURNING prefix STRING
Returns the prefix of an XML attribute defined at a given position on the current XML node, or NULL.
getAttributeValue(
   pos INTEGER )
  RETURNING value STRING
Returns the value of an XML attribute defined at a given position on the current XML node, or NULL.
findAttributeValue(
   name STRING,
   ns STRING )
  RETURNING value STRING
Returns the value of an XML attribute of a given name and/or namespace on the current XML node, or NULL.
Table 9. Object methods: Namespace
Name Description
lookupNamespace(
   prefix STRING )
  RETURNING nsuri STRING
Looks up the namespace URI associated with a given prefix starting from the current XML node the StaxReader cursor is pointing to.
lookupPrefix(
   ns STRING )
  RETURNING prefix STRING
Looks up the prefix associated with a given namespace URI, starting from the current XML node the StaxReader cursor is pointing to.
getNamespaceCount()
  RETURNING num INTEGER
Returns the number of namespace declarations defined on the current XML node, or zero.
getNamespacePrefix(
   pos INTEGER )
  RETURNING prefix STRING
Returns the prefix of a namespace declaration defined at a given position on the current XML node, or NULL.
getNamespaceURI(
   pos INTEGER )
  RETURNING nsuri STRING
Returns the URI of a namespace declaration defined at a given position on the current XML node, or NULL.
Table 10. Object methods: Navigation
Name Description
hasNext()
  RETURNING flag INTEGER
Checks whether the StaxReader cursor can be moved to a XML node next to it.
next()
Moves the StaxReader cursor to the next XML node.
nextTag()
Moves the StaxReader cursor to the next XML open or end tag
nextSibling()
Moves the StaxReader cursor to the immediate next sibling XML Element of the current node, skipping all its child nodes.