XMLFragmentStreamReader

This streamreader allows for reading document fragments. It does so by wrapping the reader into a pair of wrapper elements, and then ignoring those on reading.

Created by pdvrieze on 04/11/15.

This streamreader allows for reading document fragments. It does so by wrapping the reader into a pair of wrapper elements, and then ignoring those on reading. Created by pdvrieze on 04/11/15.

actual class XMLFragmentStreamReader(text: String, wrapperNamespaceContext: Iterable<Namespace>) : XmlDelegatingReader(source)

This streamreader allows for reading document fragments. It does so by wrapping the reader into a pair of wrapper elements, and then ignoring those on reading.

Created by pdvrieze on 04/11/15.

This streamreader allows for reading document fragments. It does so by wrapping the reader into a pair of wrapper elements, and then ignoring those on reading. This avoids the restriction of xml that a document only has 1 document element.

Author

Created by pdvrieze on 04/11/15.

Parameters

reader

The reader to read the "fragment" from.

namespaces

A list of namespace/prefix declarations to resolve for the fragment.

Constructors

Link copied to clipboard
constructor(reader: Reader, namespaces: Iterable<Namespace>)
constructor(text: String, wrapperNamespaceContext: Iterable<Namespace>)
constructor(reader: Reader, namespaces: Iterable<<Error class: unknown class>>)

Types

Link copied to clipboard
actual object Companion
expect object Companion
actual object Companion
actual object Companion

Properties

Link copied to clipboard
open override val attributeCount: Int
open override val attributeCount: Int
open override val attributeCount: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val delegate: <Error class: unknown class>
Link copied to clipboard
open override val depth: Int
open override val depth: Int
open override val depth: Int
Link copied to clipboard
open override val 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).

open override val 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).

open override val 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
open override val eventType: EventType
open override val eventType: EventType
Link copied to clipboard
Link copied to clipboard
open override val isStarted: Boolean
open override val isStarted: Boolean
open override val isStarted: Boolean
Link copied to clipboard
open override val localName: String
open override val localName: String
open override val localName: String
Link copied to clipboard
var localNamespaceContext: FragmentNamespaceContext
Link copied to clipboard
open override val name: QName
open override val name: QName
open override val name: QName
Link copied to clipboard

The current namespace context

The current namespace context

The current namespace context

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

Data for processing instructions.

open override val piData: String

Data for processing instructions.

open override val piData: String

Data for processing instructions.

Link copied to clipboard
open override val piTarget: String

Target for processing instructions.

open override val piTarget: String

Target for processing instructions.

open override val piTarget: String

Target for processing instructions.

Link copied to clipboard
open override val prefix: String
open override val prefix: String
open override val prefix: String
Link copied to clipboard
Link copied to clipboard
open override val 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).

open override val 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).

open override val 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
open override val text: String
open override val text: String
Link copied to clipboard
open override val 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).

open override val 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).

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

Is the currrent element character content

open override fun isCharacters(): Boolean

Is the currrent element character content

open override 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 override fun isEndElement(): Boolean
open override fun isEndElement(): Boolean
open override fun isEndElement(): Boolean
Link copied to clipboard
Link copied to clipboard
open override fun isStartElement(): Boolean

Is the current element a start element

open override fun isStartElement(): Boolean

Is the current element a start element

open override fun isStartElement(): Boolean

Is the current element a start element

Link copied to clipboard
open override fun isWhitespace(): Boolean
open override fun isWhitespace(): Boolean
open override fun isWhitespace(): Boolean
Link copied to clipboard
Link copied to clipboard
open operator override fun next(): EventType
open operator override fun next(): EventType
open operator override fun next(): EventType
open fun next(): <Error class: unknown class>
Link copied to clipboard
open override fun nextTag(): EventType

Overridden such that it will be valid, even when overriding next.

open override fun nextTag(): EventType

Overridden such that it will be valid, even when overriding next.

open override fun nextTag(): EventType

Overridden such that it will be valid, even when overriding next.

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 override fun require(type: EventType, name: QName?)
open override fun require(type: EventType, namespace: String?, name: String?)
open override fun require(type: EventType, name: QName?)
open override fun require(type: EventType, namespace: String?, name: String?)
open override fun require(type: EventType, name: QName?)
open override 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.

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.