XmlReader

interface XmlReader : Closeable, Iterator<EventType> (source)

Interface that is the entry point to the xml parsing. All implementations implement this interface, generally by delegating to a platform specific parser.

Inheritors

Properties

Link copied to clipboard
abstract val attributeCount: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract val depth: Int
Link copied to clipboard
abstract val encoding: String?
Link copied to clipboard
abstract val eventType: EventType
Link copied to clipboard
abstract val isStarted: Boolean
Link copied to clipboard
abstract val localName: String
Link copied to clipboard
abstract val locationInfo: String?

Get some information on the current location in the file. This is implementation dependent.

Link copied to clipboard
open val name: QName
Link copied to clipboard

The current namespace context

Link copied to clipboard
Link copied to clipboard
abstract val namespaceURI: String
Link copied to clipboard
abstract val piData: String

Data for processing instructions.

Link copied to clipboard
abstract val piTarget: String

Target for processing instructions.

Link copied to clipboard
abstract val prefix: String
Link copied to clipboard
Link copied to clipboard
abstract val standalone: Boolean?
Link copied to clipboard
abstract val text: String
Link copied to clipboard
abstract val version: String?

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
abstract 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
abstract fun getAttributeLocalName(index: Int): String
Link copied to clipboard
open fun getAttributeName(index: Int): QName
Link copied to clipboard
abstract fun getAttributeNamespace(index: Int): String
Link copied to clipboard
abstract fun getAttributePrefix(index: Int): String
Link copied to clipboard
abstract fun getAttributeValue(index: Int): String
open fun getAttributeValue(name: QName): String?
abstract fun getAttributeValue(nsUri: String?, localName: String): String?
Link copied to clipboard
abstract fun getNamespacePrefix(namespaceUri: String): String?
Link copied to clipboard
abstract fun getNamespaceURI(prefix: String): String?
Link copied to clipboard
abstract 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
abstract 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

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

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
Link copied to clipboard

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