IXmlDictionaryReader Interface

System.Xml

Represents a reader that provides fast, forward-only access to a document containing dictionary-encoded XML information.

Syntax

public interface IXmlDictionaryReader : XmlReader

Description

IXmlDictionaryReader extends the functionality of the XmlReader class by providing specialized methods for working with XML documents that have been encoded using an XmlDictionary. This can significantly improve performance when dealing with large XML datasets where many string values are repeated. By using integer keys from the dictionary, the reader can avoid repeatedly parsing and comparing strings.

Methods

Read()

Moves the reader to the next node in the XML document.

bool Read();

Returns

true if the next node was read successfully; false if there are no more nodes to read.

ReadContentAsString()

Reads the text content of the current node as a string.

string ReadContentAsString();

Returns

The text content of the current node.

LookupPrefix(string prefix)

Resolves the given prefix into a namespace URI using the current node context.

string LookupPrefix(string prefix);

Parameters

  • prefix: The namespace prefix to resolve.

Returns

The namespace URI for the given prefix, or null if the prefix cannot be resolved.

ReadElementContentAsString()

Reads the content of an element as a string. This method skips over any child elements and reads only the text content.

string ReadElementContentAsString();

Returns

The text content of the element.

Implemented By

This interface is implemented by classes such as XmlDictionaryReader.

See Also