C# 클래스 CsQuery.HtmlParser.HtmlData

Reference data about HTML tags and attributes; methods to test tokens for certain properties; and the tokenizer.
파일 보기 프로젝트 열기: prepare/HTML-Renderer 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
Debug bool
NumberChars HashSet
Units HashSet

공개 메소드들

메소드 설명
AttributeEncode ( string text, bool alwaysQuote, string &quoteChar ) : string

HtmlEncode a string, except for double-quotes, so it can be enclosed in single-quotes.

ChildrenAllowed ( string nodeName ) : bool

Test whether this element can have children.

ChildrenAllowed ( ushort tokenId ) : bool

Test whether this element may have children.

HasValueProperty ( string nodeName ) : bool

Test if a node type has a VALUE property.

HasValueProperty ( ushort nodeNameToken ) : bool

Test if a node type has a VALUE property.

HtmlChildrenNotAllowed ( string nodeName ) : bool

This type does not allow HTML children. Some of these types may allow text but not HTML.

HtmlChildrenNotAllowed ( ushort nodeId ) : bool

This type does not allow HTML children. Some of these types may allow text but not HTML.

IsBlock ( string nodeName ) : bool

Test whether the node is a block-type element

IsBlock ( ushort tokenId ) : bool

Test whether the node is a block-type element.

IsBoolean ( string propertyName ) : bool

Test whether the attribute is a boolean type.

IsBoolean ( ushort tokenId ) : bool

Test whether the attribute is a boolean type.

IsCaseInsensitiveValues ( string attributeName ) : bool

Test whether an attribute has case-insensitive values (for selection purposes)

IsCaseInsensitiveValues ( ushort attributeToken ) : bool

Test whether an attribute has case-insensitive values (for selection purposes)

IsFormInputControl ( string nodeName ) : bool

Test if the node name is a form input control.

IsFormInputControl ( ushort nodeNameToken ) : bool

Test if the node name is a form input control

SpecialTagAction ( string tag, string newTag, bool isDocument = true ) : ushort

For testing only - the production code never uses this version.

SpecialTagAction ( ushort parentTagId, ushort newTagId ) : ushort

Return the type of action that should be performed given a tag, and a new tag found as a child of that tag.

Some tags have inner HTML but are often not closed properly. There are two possible situations. A tag may not have a nested instance of itself, and therefore any recurrence of that tag implies the previous one is closed. Other tag closings are simply optional, but are not repeater tags (e.g. body, html). These should be handled automatically by the logic that bubbles any closing tag to its parent if it doesn't match the current tag. The exception is <head> which technically does not require a close, but we would not expect to find another close tag Complete list of optional closing tags: HTML, HEAD, BODY, P, DT, DD, LI, OPTION, THEAD, TH, TBODY, TR, TD, TFOOT, COLGROUP body, html will be closed automatically at the end of parsing and are also not required.

SpecialTagActionForDocument ( ushort parentTagId, ushort newTagId ) : ushort

Determine a course of action given a new tag, its parent, and whether or not to treat this as a document. Return 1 to close, 0 to do nothing, or an ID to generate.

TokenName ( ushort tokenId ) : string

Return a token name for an ID.

Tokenize ( string name ) : ushort

Return a token for a name

TokenizeCaseSensitive ( string name ) : ushort

Return a token for a name, adding to the index if it doesn't exist. When indexing tags and attributes, TokenID(tokenName) should be used.

비공개 메소드들

메소드 설명
HtmlData ( ) : System
PopulateTokenHashset ( IEnumerable tokens ) : HashSet
TokenizeImpl ( string tokenName ) : ushort

Return a token ID for a name, adding to the index if it doesn't exist. When indexing tags and attributes, ignoreCase should be used.

Touch ( ) : void
setBit ( IEnumerable tokens, TokenProperties bit ) : void

For each value in "tokens" (ignoring case) sets the specified bit in the reference table.

setBit ( IEnumerable tokens, TokenProperties bit ) : void

For each value in "tokens" sets the specified bit in the reference table.

setBit ( ushort token, TokenProperties bit ) : void

Set the specified bit in the reference table for "token".

메소드 상세

AttributeEncode() 공개 정적인 메소드

HtmlEncode a string, except for double-quotes, so it can be enclosed in single-quotes.
public static AttributeEncode ( string text, bool alwaysQuote, string &quoteChar ) : string
text string /// The text to encode ///
alwaysQuote bool /// When true, the attribute value will be quoted even if quotes are not required by the value. ///
quoteChar string /// [out] The quote character. ///
리턴 string

ChildrenAllowed() 공개 정적인 메소드

Test whether this element can have children.
public static ChildrenAllowed ( string nodeName ) : bool
nodeName string /// The node name to test. ///
리턴 bool

ChildrenAllowed() 공개 정적인 메소드

Test whether this element may have children.
public static ChildrenAllowed ( ushort tokenId ) : bool
tokenId ushort /// The token ID. ///
리턴 bool

HasValueProperty() 공개 정적인 메소드

Test if a node type has a VALUE property.
public static HasValueProperty ( string nodeName ) : bool
nodeName string /// The node name token. ///
리턴 bool

HasValueProperty() 공개 정적인 메소드

Test if a node type has a VALUE property.
public static HasValueProperty ( ushort nodeNameToken ) : bool
nodeNameToken ushort /// Token ID of the node name. ///
리턴 bool

HtmlChildrenNotAllowed() 공개 정적인 메소드

This type does not allow HTML children. Some of these types may allow text but not HTML.
public static HtmlChildrenNotAllowed ( string nodeName ) : bool
nodeName string /// The node name to test. ///
리턴 bool

HtmlChildrenNotAllowed() 공개 정적인 메소드

This type does not allow HTML children. Some of these types may allow text but not HTML.
public static HtmlChildrenNotAllowed ( ushort nodeId ) : bool
nodeId ushort /// The token ID ///
리턴 bool

IsBlock() 공개 정적인 메소드

Test whether the node is a block-type element
public static IsBlock ( string nodeName ) : bool
nodeName string /// The node name to test. ///
리턴 bool

IsBlock() 공개 정적인 메소드

Test whether the node is a block-type element.
public static IsBlock ( ushort tokenId ) : bool
tokenId ushort /// The token ID of the node ///
리턴 bool

IsBoolean() 공개 정적인 메소드

Test whether the attribute is a boolean type.
public static IsBoolean ( string propertyName ) : bool
propertyName string /// The attribute or property name ///
리턴 bool

IsBoolean() 공개 정적인 메소드

Test whether the attribute is a boolean type.
public static IsBoolean ( ushort tokenId ) : bool
tokenId ushort /// The token ID ///
리턴 bool

IsCaseInsensitiveValues() 공개 정적인 메소드

Test whether an attribute has case-insensitive values (for selection purposes)
public static IsCaseInsensitiveValues ( string attributeName ) : bool
attributeName string /// Name of the attribute. ///
리턴 bool

IsCaseInsensitiveValues() 공개 정적인 메소드

Test whether an attribute has case-insensitive values (for selection purposes)
public static IsCaseInsensitiveValues ( ushort attributeToken ) : bool
attributeToken ushort /// Token ID of the attribute. ///
리턴 bool

IsFormInputControl() 공개 정적인 메소드

Test if the node name is a form input control.
public static IsFormInputControl ( string nodeName ) : bool
nodeName string /// The node name to test. ///
리턴 bool

IsFormInputControl() 공개 정적인 메소드

Test if the node name is a form input control
public static IsFormInputControl ( ushort nodeNameToken ) : bool
nodeNameToken ushort /// The node name token. ///
리턴 bool

SpecialTagAction() 공개 정적인 메소드

For testing only - the production code never uses this version.
public static SpecialTagAction ( string tag, string newTag, bool isDocument = true ) : ushort
tag string /// . ///
newTag string /// . ///
isDocument bool /// . ///
리턴 ushort

SpecialTagAction() 공개 정적인 메소드

Return the type of action that should be performed given a tag, and a new tag found as a child of that tag.
Some tags have inner HTML but are often not closed properly. There are two possible situations. A tag may not have a nested instance of itself, and therefore any recurrence of that tag implies the previous one is closed. Other tag closings are simply optional, but are not repeater tags (e.g. body, html). These should be handled automatically by the logic that bubbles any closing tag to its parent if it doesn't match the current tag. The exception is <head> which technically does not require a close, but we would not expect to find another close tag Complete list of optional closing tags: HTML, HEAD, BODY, P, DT, DD, LI, OPTION, THEAD, TH, TBODY, TR, TD, TFOOT, COLGROUP body, html will be closed automatically at the end of parsing and are also not required.
public static SpecialTagAction ( ushort parentTagId, ushort newTagId ) : ushort
parentTagId ushort /// The parent tag's token. ///
newTagId ushort /// The new child tag's token. ///
리턴 ushort

SpecialTagActionForDocument() 공개 정적인 메소드

Determine a course of action given a new tag, its parent, and whether or not to treat this as a document. Return 1 to close, 0 to do nothing, or an ID to generate.
public static SpecialTagActionForDocument ( ushort parentTagId, ushort newTagId ) : ushort
parentTagId ushort /// The parent tag ID ///
newTagId ushort /// The new tag ID found ///
리턴 ushort

TokenName() 공개 정적인 메소드

Return a token name for an ID.
public static TokenName ( ushort tokenId ) : string
tokenId ushort /// The token ID ///
리턴 string

Tokenize() 공개 정적인 메소드

Return a token for a name
public static Tokenize ( string name ) : ushort
name string /// The name to tokenize. ///
리턴 ushort

TokenizeCaseSensitive() 공개 정적인 메소드

Return a token for a name, adding to the index if it doesn't exist. When indexing tags and attributes, TokenID(tokenName) should be used.
public static TokenizeCaseSensitive ( string name ) : ushort
name string /// The name to tokenize ///
리턴 ushort

프로퍼티 상세

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

Indicates whether this has been compiled in debug mode. When true, DOM index paths will be stored internally in extended human-readable format.
public static bool Debug
리턴 bool

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

Things that can be in a CSS number
public static HashSet NumberChars
리턴 HashSet

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

The units that are allowable unit strings in a CSS style..
public static HashSet Units
리턴 HashSet