Table of Contents

Class MixedCodeDocument

Namespace
HtmlAgilityPack
Assembly
HtmlAgilityPack.dll

Represents a document with mixed code and text. ASP, ASPX, JSP, are good example of such documents.

public class MixedCodeDocument
Inheritance
MixedCodeDocument
Inherited Members

Constructors

MixedCodeDocument()

Creates a mixed code document instance.

public MixedCodeDocument()

Fields

TokenCodeEnd

Gets or sets the token representing code end.

public string TokenCodeEnd

Field Value

string

TokenCodeStart

Gets or sets the token representing code start.

public string TokenCodeStart

Field Value

string

TokenDirective

Gets or sets the token representing code directive.

public string TokenDirective

Field Value

string

TokenResponseWrite

Gets or sets the token representing response write directive.

public string TokenResponseWrite

Field Value

string

Properties

Code

Gets the code represented by the mixed code document seen as a template.

public string Code { get; }

Property Value

string

CodeFragments

Gets the list of code fragments in the document.

public MixedCodeDocumentFragmentList CodeFragments { get; }

Property Value

MixedCodeDocumentFragmentList

Fragments

Gets the list of all fragments in the document.

public MixedCodeDocumentFragmentList Fragments { get; }

Property Value

MixedCodeDocumentFragmentList

StreamEncoding

Gets the encoding of the stream used to read the document.

public Encoding StreamEncoding { get; }

Property Value

Encoding

TextFragments

Gets the list of text fragments in the document.

public MixedCodeDocumentFragmentList TextFragments { get; }

Property Value

MixedCodeDocumentFragmentList

Methods

CreateCodeFragment()

Create a code fragment instances.

public MixedCodeDocumentCodeFragment CreateCodeFragment()

Returns

MixedCodeDocumentCodeFragment

The newly created code fragment instance.

CreateTextFragment()

Create a text fragment instances.

public MixedCodeDocumentTextFragment CreateTextFragment()

Returns

MixedCodeDocumentTextFragment

The newly created text fragment instance.

Load(Stream)

Loads a mixed code document from a stream.

public void Load(Stream stream)

Parameters

stream Stream

The input stream.

Load(Stream, bool)

Loads a mixed code document from a stream.

public void Load(Stream stream, bool detectEncodingFromByteOrderMarks)

Parameters

stream Stream

The input stream.

detectEncodingFromByteOrderMarks bool

Indicates whether to look for byte order marks at the beginning of the file.

Load(Stream, Encoding)

Loads a mixed code document from a stream.

public void Load(Stream stream, Encoding encoding)

Parameters

stream Stream

The input stream.

encoding Encoding

The character encoding to use.

Load(Stream, Encoding, bool)

Loads a mixed code document from a stream.

public void Load(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks)

Parameters

stream Stream

The input stream.

encoding Encoding

The character encoding to use.

detectEncodingFromByteOrderMarks bool

Indicates whether to look for byte order marks at the beginning of the file.

Load(Stream, Encoding, bool, int)

Loads a mixed code document from a stream.

public void Load(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int buffersize)

Parameters

stream Stream

The input stream.

encoding Encoding

The character encoding to use.

detectEncodingFromByteOrderMarks bool

Indicates whether to look for byte order marks at the beginning of the file.

buffersize int

The minimum buffer size.

Load(TextReader)

Loads the mixed code document from the specified TextReader.

public void Load(TextReader reader)

Parameters

reader TextReader

The TextReader used to feed the HTML data into the document.

Load(string)

Loads a mixed code document from a file.

public void Load(string path)

Parameters

path string

The complete file path to be read.

Load(string, bool)

Loads a mixed code document from a file.

public void Load(string path, bool detectEncodingFromByteOrderMarks)

Parameters

path string

The complete file path to be read.

detectEncodingFromByteOrderMarks bool

Indicates whether to look for byte order marks at the beginning of the file.

Load(string, Encoding)

Loads a mixed code document from a file.

public void Load(string path, Encoding encoding)

Parameters

path string

The complete file path to be read.

encoding Encoding

The character encoding to use.

Load(string, Encoding, bool)

Loads a mixed code document from a file.

public void Load(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks)

Parameters

path string

The complete file path to be read.

encoding Encoding

The character encoding to use.

detectEncodingFromByteOrderMarks bool

Indicates whether to look for byte order marks at the beginning of the file.

Load(string, Encoding, bool, int)

Loads a mixed code document from a file.

public void Load(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks, int buffersize)

Parameters

path string

The complete file path to be read.

encoding Encoding

The character encoding to use.

detectEncodingFromByteOrderMarks bool

Indicates whether to look for byte order marks at the beginning of the file.

buffersize int

The minimum buffer size.

LoadHtml(string)

Loads a mixed document from a text

public void LoadHtml(string html)

Parameters

html string

The text to load.

Save(Stream)

Saves the mixed document to the specified stream.

public void Save(Stream outStream)

Parameters

outStream Stream

The stream to which you want to save.

Save(Stream, Encoding)

Saves the mixed document to the specified stream.

public void Save(Stream outStream, Encoding encoding)

Parameters

outStream Stream

The stream to which you want to save.

encoding Encoding

The character encoding to use.

Save(StreamWriter)

Saves the mixed document to the specified StreamWriter.

public void Save(StreamWriter writer)

Parameters

writer StreamWriter

The StreamWriter to which you want to save.

Save(TextWriter)

Saves the mixed document to the specified TextWriter.

public void Save(TextWriter writer)

Parameters

writer TextWriter

The TextWriter to which you want to save.

Save(string)

Saves the mixed document to the specified file.

public void Save(string filename)

Parameters

filename string

The location of the file where you want to save the document.

Save(string, Encoding)

Saves the mixed document to the specified file.

public void Save(string filename, Encoding encoding)

Parameters

filename string

The location of the file where you want to save the document.

encoding Encoding

The character encoding to use.