OpenXmlReader OpenXmlReader OpenXmlReader Class

Definition

Represents the Open XML reader class.

public abstract class OpenXmlReader : IDisposable
type OpenXmlReader = class
    interface IDisposable
Public MustInherit Class OpenXmlReader
Implements IDisposable
Inheritance
OpenXmlReaderOpenXmlReaderOpenXmlReader
Derived
Implements

Constructors

OpenXmlReader() OpenXmlReader() OpenXmlReader()

Initializes a new instance of the OpenXmlReader class.

OpenXmlReader(Boolean) OpenXmlReader(Boolean) OpenXmlReader(Boolean)

Initializes a new instance of the OpenXmlReader class using the supplied Boolean value.

Properties

Attributes Attributes Attributes

Gets the list of attributes of the current element.

Depth Depth Depth

Gets the depth of the current node in the XML document. The depth of the root element is 0.

ElementType ElementType ElementType

Gets the type of the corresponding strongly typed class of the current element.

Encoding Encoding Encoding

Gets the encoding of the XML file.

EOF EOF EOF

When overridden in a derived class, gets a value that indicates whether the reader is positioned at the end of the stream.

HasAttributes HasAttributes HasAttributes

Gets a value that indicates whether the current node has any attributes.

IsEndElement IsEndElement IsEndElement

When overridden in a derived class, gets a value that indicates whether the current node is an element end.

IsMiscNode IsMiscNode IsMiscNode

When overridden in a derived class, gets a value that indicates whether the current node is a miscellaneous XML node (non element).

IsStartElement IsStartElement IsStartElement

When overridden in a derived class, gets a value that indicates whether the current node is an element start.

LocalName LocalName LocalName

When overridden in a derived class, gets the local name of the current node.

NamespaceDeclarations NamespaceDeclarations NamespaceDeclarations

Gets the namespace declarations of the current element.

NamespaceUri NamespaceUri NamespaceUri

When overridden in a derived class, gets the namespace URI (as defined in the W3C Namespace specification) of the node on which the reader is positioned.

Prefix Prefix Prefix

When overridden in a derived class, gets the namespace prefix associated with the current node.

ReadMiscNodes ReadMiscNodes ReadMiscNodes

Gets a value that indicates whether the OpenXmlReader will read or skip all miscellaneous nodes.

StandaloneXml StandaloneXml StandaloneXml

Gets the standalone property in the XML declaration of the XML stream. The default value is null.

Methods

Close() Close() Close()

Closes the reader.

Create(OpenXmlElement) Create(OpenXmlElement) Create(OpenXmlElement)

Creates an OpenXmlReader from the OpenXmlElement (travel the DOM tree).

Create(OpenXmlPart) Create(OpenXmlPart) Create(OpenXmlPart)

Creates an OpenXmlReader from the specified OpenXmlPart.

Create(Stream) Create(Stream) Create(Stream)

Creates an OpenXmlReader from the specified part stream.

Create(OpenXmlElement, Boolean) Create(OpenXmlElement, Boolean) Create(OpenXmlElement, Boolean)

Creates an OpenXmlReader from the OpenXmlElement (travel the DOM tree).

Create(OpenXmlPart, Boolean) Create(OpenXmlPart, Boolean) Create(OpenXmlPart, Boolean)

Creates an OpenXmlReader from the specified OpenXmlPart and Boolean values.

Create(Stream, Boolean) Create(Stream, Boolean) Create(Stream, Boolean)

Creates an OpenXmlReader from the specified part stream and Boolean values.

Dispose() Dispose() Dispose()

Closes the reader, and releases all resources.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Closes the reader, and releases all resources.

GetText() GetText() GetText()

Gets the text of the element if the element is an OpenXmlLeafTextElement. Returns String.Empty for other elements.

LoadCurrentElement() LoadCurrentElement() LoadCurrentElement()

Loads the element at current cursor.

Read() Read() Read()

Moves to read the next element.

ReadFirstChild() ReadFirstChild() ReadFirstChild()

Moves to read the first child element.

ReadNextSibling() ReadNextSibling() ReadNextSibling()

Moves to read the next sibling element.

Skip() Skip() Skip()

Skips the child elements of the current node.

ThrowIfObjectDisposed() ThrowIfObjectDisposed() ThrowIfObjectDisposed()

Thrown if the object is disposed.

Applies to