XmlBufferReader

A reader that presents a list of events as an xml reader. This is designed to work together with XmlBufferedWriter.

Constructors

Link copied to clipboard
constructor(buffer: List<XmlEvent>)
constructor(buffer: List<XmlEvent>, initialContext: IterableNamespaceContext)

Properties

Link copied to clipboard
open override val attributeCount: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val depth: Int
Link copied to clipboard
open override var encoding: String?

The declared encoding for the document. Unlike general parsing, this value is accessible after reading the document element. The document element must be the first non-whitespace element. The value for this property before document element presence is known is implementation defined (and may change).

Link copied to clipboard
open override val eventType: EventType
Link copied to clipboard
Link copied to clipboard
open override val isStarted: Boolean
Link copied to clipboard
open override val localName: String
Link copied to clipboard
open val name: QName
Link copied to clipboard

The current namespace context

Link copied to clipboard
open override val namespaceDecls: List<Namespace>
Link copied to clipboard
open override val namespaceURI: String
Link copied to clipboard
open override val piData: String

Data for processing instructions.

Link copied to clipboard
open override val piTarget: String

Target for processing instructions.

Link copied to clipboard
open override val prefix: String
Link copied to clipboard
Link copied to clipboard
open override var standalone: Boolean?

The declared standalone status for the document. Unlike general parsing, this value is accessible after reading the document element. The document element must be the first non-whitespace element. The value for this property before document element presence is known is implementation defined (and may change).

Link copied to clipboard
open override val text: String
Link copied to clipboard
open override var version: String?

The declared xml version for the document. Unlike general parsing, this value is accessible after reading the document element. The document element must be the first non-whitespace element. The value for this property before document element presence is known is implementation defined (and may change).

Functions

Link copied to clipboard

Get the next text sequence in the reader. This will skip over comments and ignorable whitespace (starting the content), but not tags. Any tags encountered with cause an exception to be thrown. It can either be invoked when in a start tag to return all text content, or on a content element to include it (if text or cdata) and all subsequent siblings.

Link copied to clipboard
Link copied to clipboard
open override fun close()
Link copied to clipboard

Differs from .siblingsToFragment in that it skips the current event.

Link copied to clipboard

Read the current element (and content) only into a fragment.

Link copied to clipboard
open override fun getAttributeLocalName(index: Int): String
Link copied to clipboard
open fun getAttributeName(index: Int): QName
Link copied to clipboard
open override fun getAttributeNamespace(index: Int): String
Link copied to clipboard
open override fun getAttributePrefix(index: Int): String
Link copied to clipboard
open override fun getAttributeValue(index: Int): String
open override fun getAttributeValue(nsUri: String?, localName: String): String?
open fun getAttributeValue(name: QName): String?
Link copied to clipboard
open override fun getNamespacePrefix(namespaceUri: String): String?
Link copied to clipboard
open override fun getNamespaceURI(prefix: String): String?
Link copied to clipboard
open operator override fun hasNext(): Boolean
Link copied to clipboard
open fun isCharacters(): Boolean

Is the currrent element character content

Link copied to clipboard
fun XmlReader.isElement(elementname: QName): Boolean

fun XmlReader.isElement(type: EventType, elementname: QName): Boolean
fun XmlReader.isElement(elementNamespace: String?, elementName: String, elementPrefix: String? = null): Boolean
fun XmlReader.isElement(type: EventType, elementNamespace: String?, elementName: String, elementPrefix: String? = null): Boolean

Check that the current state is a start element for the given name. The mPrefix is ignored.

Link copied to clipboard
open fun isEndElement(): Boolean
Link copied to clipboard
Link copied to clipboard

Is the current element a start element

Link copied to clipboard
open fun isWhitespace(): Boolean
Link copied to clipboard
Link copied to clipboard
open operator override fun next(): EventType
Link copied to clipboard
open fun nextTag(): EventType

Get the next tag. This must call next, not use the underlying stream.

Link copied to clipboard

From a start tag read the text only content of the element. Comments are allowed and handled, but subtags are not allowed. This tag finishes at the end of the element.

Link copied to clipboard
open fun require(type: EventType, name: QName?)
open fun require(type: EventType, namespace: String?, name: String?)
Link copied to clipboard
fun reset()

Reset the reader to the start

Link copied to clipboard

Read the current element (and content) and all its siblings into a fragment.

Link copied to clipboard

From a start element, skip all element content until the corresponding end element has been read. After invocation the end element has just been read (and would be returned on relevant state calls).

Link copied to clipboard

Skil the preamble events in the stream reader

Link copied to clipboard
Link copied to clipboard

Write the current event to the writer. This will not move the reader.