C# Class HtmlAgilityPack.HtmlNodeNavigator

Represents an HTML navigator on an HTML document seen as a data store.
Inheritance: System.Xml.XPath.XPathNavigator
Datei anzeigen Open project: henryford/FreakOut Class Usage Examples

Public Methods

Method Description
Clone ( ) : XPathNavigator

Creates a new HtmlNavigator positioned at the same node as this HtmlNavigator.

GetAttribute ( string localName, string namespaceURI ) : string

Gets the value of the HTML attribute with the specified LocalName and NamespaceURI.

GetNamespace ( string name ) : string

Returns the value of the namespace node corresponding to the specified local name. Always returns string.Empty for the HtmlNavigator implementation.

HtmlNodeNavigator ( Stream stream ) : System

Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.

HtmlNodeNavigator ( Stream stream, Encoding encoding ) : System

Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.

HtmlNodeNavigator ( Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks ) : System

Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.

HtmlNodeNavigator ( Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int buffersize ) : System

Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.

HtmlNodeNavigator ( Stream stream, bool detectEncodingFromByteOrderMarks ) : System

Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.

HtmlNodeNavigator ( TextReader reader ) : System

Initializes a new instance of the HtmlNavigator and loads an HTML document from a TextReader.

HtmlNodeNavigator ( string path ) : System

Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.

HtmlNodeNavigator ( string path, Encoding encoding ) : System

Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.

HtmlNodeNavigator ( string path, Encoding encoding, bool detectEncodingFromByteOrderMarks ) : System

Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.

HtmlNodeNavigator ( string path, Encoding encoding, bool detectEncodingFromByteOrderMarks, int buffersize ) : System

Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.

HtmlNodeNavigator ( string path, bool detectEncodingFromByteOrderMarks ) : System

Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.

IsSamePosition ( XPathNavigator other ) : bool

Determines whether the current HtmlNavigator is at the same position as the specified HtmlNavigator.

MoveTo ( XPathNavigator other ) : bool

Moves to the same position as the specified HtmlNavigator.

MoveToAttribute ( string localName, string namespaceURI ) : bool

Moves to the HTML attribute with matching LocalName and NamespaceURI.

MoveToFirst ( ) : bool

Moves to the first sibling of the current node.

MoveToFirstAttribute ( ) : bool

Moves to the first HTML attribute.

MoveToFirstChild ( ) : bool

Moves to the first child of the current node.

MoveToFirstNamespace ( XPathNamespaceScope scope ) : bool

Moves the XPathNavigator to the first namespace node of the current element. Always returns false for the HtmlNavigator implementation.

MoveToId ( string id ) : bool

Moves to the node that has an attribute of type ID whose value matches the specified string.

MoveToNamespace ( string name ) : bool

Moves the XPathNavigator to the namespace node with the specified local name. Always returns false for the HtmlNavigator implementation.

MoveToNext ( ) : bool

Moves to the next sibling of the current node.

MoveToNextAttribute ( ) : bool

Moves to the next HTML attribute.

MoveToNextNamespace ( XPathNamespaceScope scope ) : bool

Moves the XPathNavigator to the next namespace node. Always returns falsefor the HtmlNavigator implementation.

MoveToParent ( ) : bool

Moves to the parent of the current node.

MoveToPrevious ( ) : bool

Moves to the previous sibling of the current node.

MoveToRoot ( ) : void

Moves to the root node to which the current node belongs.

Private Methods

Method Description
HtmlNodeNavigator ( ) : System
HtmlNodeNavigator ( HtmlAgilityPack.HtmlDocument doc, HtmlNode currentNode ) : System
HtmlNodeNavigator ( HtmlNodeNavigator nav ) : System
InternalTrace ( object traceValue ) : void
Reset ( ) : void

Method Details

Clone() public method

Creates a new HtmlNavigator positioned at the same node as this HtmlNavigator.
public Clone ( ) : XPathNavigator
return System.Xml.XPath.XPathNavigator

GetAttribute() public method

Gets the value of the HTML attribute with the specified LocalName and NamespaceURI.
public GetAttribute ( string localName, string namespaceURI ) : string
localName string The local name of the HTML attribute.
namespaceURI string The namespace URI of the attribute. Unsupported with the HtmlNavigator implementation.
return string

GetNamespace() public method

Returns the value of the namespace node corresponding to the specified local name. Always returns string.Empty for the HtmlNavigator implementation.
public GetNamespace ( string name ) : string
name string The local name of the namespace node.
return string

HtmlNodeNavigator() public method

Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.
public HtmlNodeNavigator ( Stream stream ) : System
stream Stream The input stream.
return System

HtmlNodeNavigator() public method

Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.
public HtmlNodeNavigator ( Stream stream, Encoding encoding ) : System
stream Stream The input stream.
encoding System.Text.Encoding The character encoding to use.
return System

HtmlNodeNavigator() public method

Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.
public HtmlNodeNavigator ( Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks ) : System
stream Stream The input stream.
encoding System.Text.Encoding The character encoding to use.
detectEncodingFromByteOrderMarks bool Indicates whether to look for byte order marks at the beginning of the stream.
return System

HtmlNodeNavigator() public method

Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.
public HtmlNodeNavigator ( Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int buffersize ) : System
stream Stream The input stream.
encoding System.Text.Encoding The character encoding to use.
detectEncodingFromByteOrderMarks bool Indicates whether to look for byte order marks at the beginning of the stream.
buffersize int The minimum buffer size.
return System

HtmlNodeNavigator() public method

Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream.
public HtmlNodeNavigator ( Stream stream, bool detectEncodingFromByteOrderMarks ) : System
stream Stream The input stream.
detectEncodingFromByteOrderMarks bool Indicates whether to look for byte order marks at the beginning of the stream.
return System

HtmlNodeNavigator() public method

Initializes a new instance of the HtmlNavigator and loads an HTML document from a TextReader.
public HtmlNodeNavigator ( TextReader reader ) : System
reader TextReader The TextReader used to feed the HTML data into the document.
return System

HtmlNodeNavigator() public method

Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.
public HtmlNodeNavigator ( string path ) : System
path string The complete file path to be read.
return System

HtmlNodeNavigator() public method

Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.
public HtmlNodeNavigator ( string path, Encoding encoding ) : System
path string The complete file path to be read.
encoding System.Text.Encoding The character encoding to use.
return System

HtmlNodeNavigator() public method

Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.
public HtmlNodeNavigator ( string path, Encoding encoding, bool detectEncodingFromByteOrderMarks ) : System
path string The complete file path to be read.
encoding System.Text.Encoding The character encoding to use.
detectEncodingFromByteOrderMarks bool Indicates whether to look for byte order marks at the beginning of the file.
return System

HtmlNodeNavigator() public method

Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.
public HtmlNodeNavigator ( string path, Encoding encoding, bool detectEncodingFromByteOrderMarks, int buffersize ) : System
path string The complete file path to be read.
encoding System.Text.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.
return System

HtmlNodeNavigator() public method

Initializes a new instance of the HtmlNavigator and loads an HTML document from a file.
public HtmlNodeNavigator ( string path, bool detectEncodingFromByteOrderMarks ) : System
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.
return System

IsSamePosition() public method

Determines whether the current HtmlNavigator is at the same position as the specified HtmlNavigator.
public IsSamePosition ( XPathNavigator other ) : bool
other System.Xml.XPath.XPathNavigator The HtmlNavigator that you want to compare against.
return bool

MoveTo() public method

Moves to the same position as the specified HtmlNavigator.
public MoveTo ( XPathNavigator other ) : bool
other System.Xml.XPath.XPathNavigator The HtmlNavigator positioned on the node that you want to move to.
return bool

MoveToAttribute() public method

Moves to the HTML attribute with matching LocalName and NamespaceURI.
public MoveToAttribute ( string localName, string namespaceURI ) : bool
localName string The local name of the HTML attribute.
namespaceURI string The namespace URI of the attribute. Unsupported with the HtmlNavigator implementation.
return bool

MoveToFirst() public method

Moves to the first sibling of the current node.
public MoveToFirst ( ) : bool
return bool

MoveToFirstAttribute() public method

Moves to the first HTML attribute.
public MoveToFirstAttribute ( ) : bool
return bool

MoveToFirstChild() public method

Moves to the first child of the current node.
public MoveToFirstChild ( ) : bool
return bool

MoveToFirstNamespace() public method

Moves the XPathNavigator to the first namespace node of the current element. Always returns false for the HtmlNavigator implementation.
public MoveToFirstNamespace ( XPathNamespaceScope scope ) : bool
scope XPathNamespaceScope An XPathNamespaceScope value describing the namespace scope.
return bool

MoveToId() public method

Moves to the node that has an attribute of type ID whose value matches the specified string.
public MoveToId ( string id ) : bool
id string A string representing the ID value of the node to which you want to move. This argument does not need to be atomized.
return bool

MoveToNamespace() public method

Moves the XPathNavigator to the namespace node with the specified local name. Always returns false for the HtmlNavigator implementation.
public MoveToNamespace ( string name ) : bool
name string The local name of the namespace node.
return bool

MoveToNext() public method

Moves to the next sibling of the current node.
public MoveToNext ( ) : bool
return bool

MoveToNextAttribute() public method

Moves to the next HTML attribute.
public MoveToNextAttribute ( ) : bool
return bool

MoveToNextNamespace() public method

Moves the XPathNavigator to the next namespace node. Always returns falsefor the HtmlNavigator implementation.
public MoveToNextNamespace ( XPathNamespaceScope scope ) : bool
scope XPathNamespaceScope An XPathNamespaceScope value describing the namespace scope.
return bool

MoveToParent() public method

Moves to the parent of the current node.
public MoveToParent ( ) : bool
return bool

MoveToPrevious() public method

Moves to the previous sibling of the current node.
public MoveToPrevious ( ) : bool
return bool

MoveToRoot() public method

Moves to the root node to which the current node belongs.
public MoveToRoot ( ) : void
return void