C# 클래스 HtmlAgilityPack.HtmlNode

상속: IXPathNavigable
파일 보기 프로젝트 열기: o2platform/O2.Platform.Projects 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
ElementsFlags System.Collections.Hashtable
HtmlNodeTypeNameComment string
HtmlNodeTypeNameDocument string
HtmlNodeTypeNameText string

Private Properties

프로퍼티 타입 설명
CloseNode void
GetId string
GetXmlComment string
HtmlNode System
HtmlNode System
SetId void
WriteAttribute void
WriteAttributes void
WriteAttributes void

공개 메소드들

메소드 설명
AppendChild ( HtmlNode newChild ) : HtmlNode

Adds the specified node to the end of the list of children of this node.

AppendChildren ( HtmlAgilityPack.HtmlNodeCollection newChildren ) : void

Adds the specified node to the end of the list of children of this node.

CanOverlapElement ( string name ) : bool

Determines if an element node can be kept overlapped.

Clone ( ) : HtmlNode

Creates a duplicate of the node

CloneNode ( bool deep ) : HtmlNode

Creates a duplicate of the node.

CloneNode ( string newName ) : HtmlNode

Creates a duplicate of the node and changes its name at the same time.

CloneNode ( string newName, bool deep ) : HtmlNode

Creates a duplicate of the node and changes its name at the same time.

CopyFrom ( HtmlNode node ) : void

Creates a duplicate of the node and the subtree under it.

CopyFrom ( HtmlNode node, bool deep ) : void

Creates a duplicate of the node.

CreateNavigator ( ) : XPathNavigator

Creates a new XPathNavigator object for navigating this HTML node.

CreateNode ( string html ) : HtmlNode

Creates an HTML node from a string representing literal HTML.

GetAttributeValue ( string name, bool def ) : bool

Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned.

GetAttributeValue ( string name, int def ) : int

Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned.

GetAttributeValue ( string name, string def ) : string

Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned.

InsertAfter ( HtmlNode newChild, HtmlNode refChild ) : HtmlNode

Inserts the specified node immediately after the specified reference node.

InsertBefore ( HtmlNode newChild, HtmlNode refChild ) : HtmlNode

Inserts the specified node immediately before the specified reference node.

IsCDataElement ( string name ) : bool

Determines if an element node is a CDATA element node.

IsClosedElement ( string name ) : bool

Determines if an element node is closed.

IsEmptyElement ( string name ) : bool

Determines if an element node is defined as empty.

IsOverlappedClosingElement ( string text ) : bool

Determines if a text corresponds to the closing tag of an node that can be kept overlapped.

PrependChild ( HtmlNode newChild ) : HtmlNode

Adds the specified node to the beginning of the list of children of this node.

PrependChildren ( HtmlAgilityPack.HtmlNodeCollection newChildren ) : void

Adds the specified node list to the beginning of the list of children of this node.

RemoveAll ( ) : void

Removes all the children and/or attributes of the current node.

RemoveAllChildren ( ) : void

Removes all the children of the current node.

RemoveChild ( HtmlNode oldChild ) : HtmlNode

Removes the specified child node.

RemoveChild ( HtmlNode oldChild, bool keepGrandChildren ) : HtmlNode

Removes the specified child node.

ReplaceChild ( HtmlNode newChild, HtmlNode oldChild ) : HtmlNode

Replaces the child node oldChild with newChild node.

SelectNodes ( string xpath ) : HtmlAgilityPack.HtmlNodeCollection

Selects a list of nodes matching the XPath expression.

SelectSingleNode ( string xpath ) : HtmlNode

Selects the first XmlNode that matches the XPath expression.

SetAttributeValue ( string name, string value ) : HtmlAgilityPack.HtmlAttribute

Helper method to set the value of an attribute of this node. If the attribute is not found, it will be created automatically.

WriteContentTo ( ) : string

Saves all the children of the node to a string.

WriteContentTo ( TextWriter outText ) : void

Saves all the children of the node to the specified TextWriter.

WriteTo ( ) : string

Saves the current node to a string.

WriteTo ( TextWriter outText ) : void

Saves the current node to the specified TextWriter.

WriteTo ( XmlWriter writer ) : void

Saves the current node to the specified XmlWriter.

비공개 메소드들

메소드 설명
CloseNode ( HtmlNode endnode ) : void
GetId ( ) : string
GetXmlComment ( HtmlAgilityPack.HtmlCommentNode comment ) : string
HtmlNode ( ) : System
HtmlNode ( HtmlNodeType type, HtmlAgilityPack.HtmlDocument ownerdocument, int index ) : System
SetId ( string id ) : void
WriteAttribute ( TextWriter outText, HtmlAgilityPack.HtmlAttribute att ) : void
WriteAttributes ( TextWriter outText, bool closing ) : void
WriteAttributes ( XmlWriter writer, HtmlNode node ) : void

메소드 상세

AppendChild() 공개 메소드

Adds the specified node to the end of the list of children of this node.
public AppendChild ( HtmlNode newChild ) : HtmlNode
newChild HtmlNode The node to add. May not be null.
리턴 HtmlNode

AppendChildren() 공개 메소드

Adds the specified node to the end of the list of children of this node.
public AppendChildren ( HtmlAgilityPack.HtmlNodeCollection newChildren ) : void
newChildren HtmlAgilityPack.HtmlNodeCollection The node list to add. May not be null.
리턴 void

CanOverlapElement() 공개 정적인 메소드

Determines if an element node can be kept overlapped.
public static CanOverlapElement ( string name ) : bool
name string The name of the element node to check. May not be null.
리턴 bool

Clone() 공개 메소드

Creates a duplicate of the node
public Clone ( ) : HtmlNode
리턴 HtmlNode

CloneNode() 공개 메소드

Creates a duplicate of the node.
public CloneNode ( bool deep ) : HtmlNode
deep bool true to recursively clone the subtree under the specified node; false to clone only the node itself.
리턴 HtmlNode

CloneNode() 공개 메소드

Creates a duplicate of the node and changes its name at the same time.
public CloneNode ( string newName ) : HtmlNode
newName string The new name of the cloned node. May not be null.
리턴 HtmlNode

CloneNode() 공개 메소드

Creates a duplicate of the node and changes its name at the same time.
public CloneNode ( string newName, bool deep ) : HtmlNode
newName string The new name of the cloned node. May not be null.
deep bool true to recursively clone the subtree under the specified node; false to clone only the node itself.
리턴 HtmlNode

CopyFrom() 공개 메소드

Creates a duplicate of the node and the subtree under it.
public CopyFrom ( HtmlNode node ) : void
node HtmlNode The node to duplicate. May not be null.
리턴 void

CopyFrom() 공개 메소드

Creates a duplicate of the node.
public CopyFrom ( HtmlNode node, bool deep ) : void
node HtmlNode The node to duplicate. May not be null.
deep bool true to recursively clone the subtree under the specified node, false to clone only the node itself.
리턴 void

CreateNavigator() 공개 메소드

Creates a new XPathNavigator object for navigating this HTML node.
public CreateNavigator ( ) : XPathNavigator
리턴 System.Xml.XPath.XPathNavigator

CreateNode() 공개 정적인 메소드

Creates an HTML node from a string representing literal HTML.
public static CreateNode ( string html ) : HtmlNode
html string The HTML text.
리턴 HtmlNode

GetAttributeValue() 공개 메소드

Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned.
public GetAttributeValue ( string name, bool def ) : bool
name string The name of the attribute to get. May not be null.
def bool The default value to return if not found.
리턴 bool

GetAttributeValue() 공개 메소드

Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned.
public GetAttributeValue ( string name, int def ) : int
name string The name of the attribute to get. May not be null.
def int The default value to return if not found.
리턴 int

GetAttributeValue() 공개 메소드

Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned.
public GetAttributeValue ( string name, string def ) : string
name string The name of the attribute to get. May not be null.
def string The default value to return if not found.
리턴 string

InsertAfter() 공개 메소드

Inserts the specified node immediately after the specified reference node.
public InsertAfter ( HtmlNode newChild, HtmlNode refChild ) : HtmlNode
newChild HtmlNode The node to insert. May not be null.
refChild HtmlNode The node that is the reference node. The newNode is placed after the refNode.
리턴 HtmlNode

InsertBefore() 공개 메소드

Inserts the specified node immediately before the specified reference node.
public InsertBefore ( HtmlNode newChild, HtmlNode refChild ) : HtmlNode
newChild HtmlNode The node to insert. May not be null.
refChild HtmlNode The node that is the reference node. The newChild is placed before this node.
리턴 HtmlNode

IsCDataElement() 공개 정적인 메소드

Determines if an element node is a CDATA element node.
public static IsCDataElement ( string name ) : bool
name string The name of the element node to check. May not be null.
리턴 bool

IsClosedElement() 공개 정적인 메소드

Determines if an element node is closed.
public static IsClosedElement ( string name ) : bool
name string The name of the element node to check. May not be null.
리턴 bool

IsEmptyElement() 공개 정적인 메소드

Determines if an element node is defined as empty.
public static IsEmptyElement ( string name ) : bool
name string The name of the element node to check. May not be null.
리턴 bool

IsOverlappedClosingElement() 공개 정적인 메소드

Determines if a text corresponds to the closing tag of an node that can be kept overlapped.
public static IsOverlappedClosingElement ( string text ) : bool
text string The text to check. May not be null.
리턴 bool

PrependChild() 공개 메소드

Adds the specified node to the beginning of the list of children of this node.
public PrependChild ( HtmlNode newChild ) : HtmlNode
newChild HtmlNode The node to add. May not be null.
리턴 HtmlNode

PrependChildren() 공개 메소드

Adds the specified node list to the beginning of the list of children of this node.
public PrependChildren ( HtmlAgilityPack.HtmlNodeCollection newChildren ) : void
newChildren HtmlAgilityPack.HtmlNodeCollection The node list to add. May not be null.
리턴 void

RemoveAll() 공개 메소드

Removes all the children and/or attributes of the current node.
public RemoveAll ( ) : void
리턴 void

RemoveAllChildren() 공개 메소드

Removes all the children of the current node.
public RemoveAllChildren ( ) : void
리턴 void

RemoveChild() 공개 메소드

Removes the specified child node.
public RemoveChild ( HtmlNode oldChild ) : HtmlNode
oldChild HtmlNode The node being removed. May not be null.
리턴 HtmlNode

RemoveChild() 공개 메소드

Removes the specified child node.
public RemoveChild ( HtmlNode oldChild, bool keepGrandChildren ) : HtmlNode
oldChild HtmlNode The node being removed. May not be null.
keepGrandChildren bool true to keep grand children of the node, false otherwise.
리턴 HtmlNode

ReplaceChild() 공개 메소드

Replaces the child node oldChild with newChild node.
public ReplaceChild ( HtmlNode newChild, HtmlNode oldChild ) : HtmlNode
newChild HtmlNode The new node to put in the child list.
oldChild HtmlNode The node being replaced in the list.
리턴 HtmlNode

SelectNodes() 공개 메소드

Selects a list of nodes matching the XPath expression.
public SelectNodes ( string xpath ) : HtmlAgilityPack.HtmlNodeCollection
xpath string The XPath expression.
리턴 HtmlAgilityPack.HtmlNodeCollection

SelectSingleNode() 공개 메소드

Selects the first XmlNode that matches the XPath expression.
public SelectSingleNode ( string xpath ) : HtmlNode
xpath string The XPath expression. May not be null.
리턴 HtmlNode

SetAttributeValue() 공개 메소드

Helper method to set the value of an attribute of this node. If the attribute is not found, it will be created automatically.
public SetAttributeValue ( string name, string value ) : HtmlAgilityPack.HtmlAttribute
name string The name of the attribute to set. May not be null.
value string The value for the attribute.
리턴 HtmlAgilityPack.HtmlAttribute

WriteContentTo() 공개 메소드

Saves all the children of the node to a string.
public WriteContentTo ( ) : string
리턴 string

WriteContentTo() 공개 메소드

Saves all the children of the node to the specified TextWriter.
public WriteContentTo ( TextWriter outText ) : void
outText System.IO.TextWriter The TextWriter to which you want to save.
리턴 void

WriteTo() 공개 메소드

Saves the current node to a string.
public WriteTo ( ) : string
리턴 string

WriteTo() 공개 메소드

Saves the current node to the specified TextWriter.
public WriteTo ( TextWriter outText ) : void
outText System.IO.TextWriter The TextWriter to which you want to save.
리턴 void

WriteTo() 공개 메소드

Saves the current node to the specified XmlWriter.
public WriteTo ( XmlWriter writer ) : void
writer System.Xml.XmlWriter The XmlWriter to which you want to save.
리턴 void

프로퍼티 상세

ElementsFlags 공개적으로 정적으로 프로퍼티

Gets a collection of flags that define specific behaviors for specific element nodes. The table contains a DictionaryEntry list with the lowercase tag name as the Key, and a combination of HtmlElementFlags as the Value.
public static Hashtable,System.Collections ElementsFlags
리턴 System.Collections.Hashtable

HtmlNodeTypeNameComment 공개적으로 정적으로 프로퍼티

Gets the name of a comment node. It is actually defined as '#comment'.
public static string HtmlNodeTypeNameComment
리턴 string

HtmlNodeTypeNameDocument 공개적으로 정적으로 프로퍼티

Gets the name of the document node. It is actually defined as '#document'.
public static string HtmlNodeTypeNameDocument
리턴 string

HtmlNodeTypeNameText 공개적으로 정적으로 프로퍼티

Gets the name of a text node. It is actually defined as '#text'.
public static string HtmlNodeTypeNameText
리턴 string