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
TokenCodeStart
Gets or sets the token representing code start.
public string TokenCodeStart
Field Value
TokenDirective
Gets or sets the token representing code directive.
public string TokenDirective
Field Value
TokenResponseWrite
Gets or sets the token representing response write directive.
public string TokenResponseWrite
Field Value
Properties
Code
Gets the code represented by the mixed code document seen as a template.
public string Code { get; }
Property Value
CodeFragments
Gets the list of code fragments in the document.
public MixedCodeDocumentFragmentList CodeFragments { get; }
Property Value
Fragments
Gets the list of all fragments in the document.
public MixedCodeDocumentFragmentList Fragments { get; }
Property Value
StreamEncoding
Gets the encoding of the stream used to read the document.
public Encoding StreamEncoding { get; }
Property Value
TextFragments
Gets the list of text fragments in the document.
public MixedCodeDocumentFragmentList TextFragments { get; }
Property Value
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
StreamThe input stream.
Load(Stream, bool)
Loads a mixed code document from a stream.
public void Load(Stream stream, bool detectEncodingFromByteOrderMarks)
Parameters
stream
StreamThe input stream.
detectEncodingFromByteOrderMarks
boolIndicates 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
Load(Stream, Encoding, bool)
Loads a mixed code document from a stream.
public void Load(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks)
Parameters
stream
StreamThe input stream.
encoding
EncodingThe character encoding to use.
detectEncodingFromByteOrderMarks
boolIndicates 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
StreamThe input stream.
encoding
EncodingThe character encoding to use.
detectEncodingFromByteOrderMarks
boolIndicates whether to look for byte order marks at the beginning of the file.
buffersize
intThe minimum buffer size.
Load(TextReader)
Loads the mixed code document from the specified TextReader.
public void Load(TextReader reader)
Parameters
reader
TextReaderThe 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
stringThe 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
stringThe complete file path to be read.
detectEncodingFromByteOrderMarks
boolIndicates 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
Load(string, Encoding, bool)
Loads a mixed code document from a file.
public void Load(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks)
Parameters
path
stringThe complete file path to be read.
encoding
EncodingThe character encoding to use.
detectEncodingFromByteOrderMarks
boolIndicates 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
stringThe complete file path to be read.
encoding
EncodingThe character encoding to use.
detectEncodingFromByteOrderMarks
boolIndicates whether to look for byte order marks at the beginning of the file.
buffersize
intThe minimum buffer size.
LoadHtml(string)
Loads a mixed document from a text
public void LoadHtml(string html)
Parameters
html
stringThe text to load.
Save(Stream)
Saves the mixed document to the specified stream.
public void Save(Stream outStream)
Parameters
outStream
StreamThe 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
StreamThe stream to which you want to save.
encoding
EncodingThe character encoding to use.
Save(StreamWriter)
Saves the mixed document to the specified StreamWriter.
public void Save(StreamWriter writer)
Parameters
writer
StreamWriterThe StreamWriter to which you want to save.
Save(TextWriter)
Saves the mixed document to the specified TextWriter.
public void Save(TextWriter writer)
Parameters
writer
TextWriterThe TextWriter to which you want to save.
Save(string)
Saves the mixed document to the specified file.
public void Save(string filename)
Parameters
filename
stringThe 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)