Class HtmlStreamReader

A streaming HTML parser implementation that will enumerate the HTML fragments in the stream.

Inheritance
System.Object
HtmlStreamReader
Implements
System.Collections.Generic.IEnumerable<HtmlFragment>
System.Collections.IEnumerable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.HtmlParsing
Assembly: EPiServer.Framework.dll
Version: 8.11.0
Syntax
public class HtmlStreamReader : IEnumerable<HtmlFragment>, IEnumerable

Constructors

HtmlStreamReader(IHtmlParserContext)

Initializes a new instance of the HtmlStreamReader class.

Declaration
public HtmlStreamReader(IHtmlParserContext context)
Parameters
Type Name Description
IHtmlParserContext context

The context that this instance of HtmlStreamReader uses to parse HTML.

HtmlStreamReader(IHtmlSource, ParserOptions)

Initializes a new instance of the HtmlStreamReader class.

Declaration
public HtmlStreamReader(IHtmlSource source, ParserOptions options)
Parameters
Type Name Description
IHtmlSource source

The HTML source provider.

ParserOptions options

The options that should be enabled when parsing HTML.

HtmlStreamReader(TextReader)

Initializes a new instance of the HtmlStreamReader class.

Declaration
public HtmlStreamReader(TextReader reader)
Parameters
Type Name Description
System.IO.TextReader reader

The reader that contains the HTML source.

HtmlStreamReader(TextReader, ParserOptions)

Initializes a new instance of the HtmlStreamReader class.

Declaration
public HtmlStreamReader(TextReader reader, ParserOptions options)
Parameters
Type Name Description
System.IO.TextReader reader

The reader that contains the HTML source.

ParserOptions options

The options that should be enabled when parsing HTML.

HtmlStreamReader(String)

Initializes a new instance of the HtmlStreamReader class.

Declaration
public HtmlStreamReader(string source)
Parameters
Type Name Description
System.String source

The HTML source.

HtmlStreamReader(String, ParserOptions)

Initializes a new instance of the HtmlStreamReader class.

Declaration
public HtmlStreamReader(string source, ParserOptions options)
Parameters
Type Name Description
System.String source

The HTML source.

ParserOptions options

The options that should be enabled when parsing HTML.

Properties

CallbackOnEndElement

Gets or sets the callback to perform when a matching End element is found.

Declaration
[Obsolete("Use the CallbackOnEndElement property on ElementFragment instead.", true)]
public Action CallbackOnEndElement { get; set; }
Property Value
Type Description
System.Action

The System.Action callback to perform.

Remarks

Important! This property is no longer supported. Use the CallbackOnEndElement property on ElementFragment instead.

Context

Gets or sets the context for the HTML parser.

Declaration
public IHtmlParserContext Context { get; }
Property Value
Type Description
IHtmlParserContext

The context.

Methods

GetEnumerator()

Returns an enumerator that iterates through the parsed HTML fragments.

Declaration
public IEnumerator<HtmlFragment> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<HtmlFragment>

A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

An System.Collections.IEnumerator object that can be used to iterate through the collection.

Remarks

Will simply delegate to the generic version of GetEnumerator.

Implements

System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable

Extension Methods