| Top |
Tokens and attributes are boxed values whose references may outlive their
tokenizer. Strings and attributes returned by getters are borrowed. Data
tokens may contain NUL bytes; use g_mime_html_token_get_data_length() rather
than strlen(), and g_mime_html_token_write_to() for lossless serialization.
void
g_mime_html_token_unref (GMimeHtmlToken *token);
Releases one reference to token
.
GMimeHtmlAttribute *
g_mime_html_attribute_ref (GMimeHtmlAttribute *attribute);
void
g_mime_html_attribute_unref (GMimeHtmlAttribute *attribute);
Releases one reference to attribute
.
GMimeHtmlAttribute * g_mime_html_attribute_new (const char *name,const char *value);
Copies name
and value
.
name |
the attribute name |
|
value |
the attribute value, or |
[nullable] |
const char *
g_mime_html_attribute_get_name (const GMimeHtmlAttribute *attribute);
const char *
g_mime_html_attribute_get_value (const GMimeHtmlAttribute *attribute);
GMimeHtmlAttributeId
g_mime_html_attribute_get_id (const GMimeHtmlAttribute *attribute);
Gets the identifier determined by the attribute's case-insensitive name.
GMimeHtmlToken * g_mime_html_token_new_tag (const char *name,gboolean is_end_tag,gboolean is_empty_element,GMimeHtmlAttribute *const *attributes,gsize n_attributes);
Copies name
and retains a reference to each attribute. The caller retains
ownership of the array and its elements.
name |
the tag name |
|
is_end_tag |
whether this is a closing tag |
|
is_empty_element |
whether this tag is self-closing |
|
attributes |
the tag attributes. |
[array length=n_attributes][element-type GMimeHtmlAttribute][transfer none][nullable] |
n_attributes |
the number of attributes |
GMimeHtmlToken * g_mime_html_token_new_comment (const char *data,gboolean bogus);
GMimeHtmlToken *
g_mime_html_token_new_script_data (const char *data);
GMimeHtmlToken * g_mime_html_token_new_doctype (const char *name,const char *public_id,const char *system_id);
Copies the supplied name and identifiers.
GMimeHtmlTokenKind
g_mime_html_token_get_kind (const GMimeHtmlToken *token);
Gets the kind of lexical token.
const char *
g_mime_html_token_get_data (const GMimeHtmlToken *token);
Character data can contain embedded NUL bytes. C callers should use
g_mime_html_token_get_data_length() rather than strlen(); use
g_mime_html_token_write_to() for lossless serialization from bindings.
gsize
g_mime_html_token_get_data_length (const GMimeHtmlToken *token);
Gets the byte length of the token data, including any embedded NUL bytes but excluding the terminating NUL.
const char *
g_mime_html_token_get_name (const GMimeHtmlToken *token);
GMimeHtmlTagId
g_mime_html_token_get_tag_id (const GMimeHtmlToken *token);
Gets the tag identifier determined by its case-insensitive name.
the tag identifier, or GMIME_HTML_TAG_UNKNOWN for an unrecognized
tag or a token that is not a tag
gboolean
g_mime_html_token_is_end_tag (const GMimeHtmlToken *token);
Tests whether token
represents an end tag.
gboolean
g_mime_html_token_is_empty_element (const GMimeHtmlToken *token);
Gets the explicit self-closing flag. This does not test whether the tag name
denotes an HTML void element; use g_mime_html_tag_id_is_empty_element() for that.
gboolean
g_mime_html_token_get_encode_entities (const GMimeHtmlToken *token);
Tests whether character references in the data were decoded and must be escaped when serialized.
gboolean
g_mime_html_token_get_is_data_state (const GMimeHtmlToken *token);
Tests whether the data was produced in the tokenizer's ordinary data state rather than a raw-text or other specialized state.
gboolean
g_mime_html_token_get_is_bogus_comment
(const GMimeHtmlToken *token);
Tests whether the comment uses HTML's bogus-comment recovery syntax.
gboolean
g_mime_html_token_get_force_quirks_mode
(const GMimeHtmlToken *token);
Gets the force-quirks flag produced while parsing a DOCTYPE.
const char *
g_mime_html_token_get_public_identifier
(const GMimeHtmlToken *token);
const char *
g_mime_html_token_get_system_identifier
(const GMimeHtmlToken *token);
gsize
g_mime_html_token_get_n_attributes (const GMimeHtmlToken *token);
Gets the number of attributes in the tag.
const GMimeHtmlAttribute * g_mime_html_token_get_attribute (const GMimeHtmlToken *token,gsize index);
const GMimeHtmlAttribute * g_mime_html_token_lookup_attribute (const GMimeHtmlToken *token,const char *name);
char *
g_mime_html_token_to_string (const GMimeHtmlToken *token);
Serializes token
. Use g_mime_html_token_write_to() to preserve embedded
NUL bytes when consuming the result from language bindings.
gboolean g_mime_html_token_write_to (const GMimeHtmlToken *token,GMimeStream *stream,GError **error);
Writes token
without closing stream
.
token |
an HTML token |
|
stream |
the output stream. |
[transfer none] |
error |
return location for an error. |
[out][optional] |
gboolean
g_mime_html_tag_id_is_empty_element (GMimeHtmlTagId id);
Tests whether id
denotes a known HTML void element.
gboolean
g_mime_html_tag_id_is_formatting_element
(GMimeHtmlTagId id);
Tests whether id
denotes an HTML formatting element, including legacy
formatting tags.
GMimeHtmlNamespace
g_mime_html_namespace_from_url (const char *url);
Known tag names, including legacy HTML elements. Names are matched without regard to ASCII case.
|
An unrecognized tag. |
||
|
The a tag. |
||
|
The abbr tag. |
||
|
The acronym tag. |
||
|
The address tag. |
||
|
The applet tag. |
||
|
The area tag. |
||
|
The article tag. |
||
|
The aside tag. |
||
|
The audio tag. |
||
|
The b tag. |
||
|
The base tag. |
||
|
The basefont tag. |
||
|
The bdi tag. |
||
|
The bdo tag. |
||
|
The bgsound tag. |
||
|
The big tag. |
||
|
The blink tag. |
||
|
The blockquote tag. |
||
|
The body tag. |
||
|
The br tag. |
||
|
The button tag. |
||
|
The canvas tag. |
||
|
The caption tag. |
||
|
The center tag. |
||
|
The cite tag. |
||
|
The code tag. |
||
|
The col tag. |
||
|
The colgroup tag. |
||
|
The command tag. |
||
|
The comment marker, represented by an exclamation mark. |
||
|
The datalist tag. |
||
|
The dd tag. |
||
|
The del tag. |
||
|
The details tag. |
||
|
The dfn tag. |
||
|
The dialog tag. |
||
|
The dir tag. |
||
|
The div tag. |
||
|
The dl tag. |
||
|
The dt tag. |
||
|
The em tag. |
||
|
The embed tag. |
||
|
The fieldset tag. |
||
|
The figcaption tag. |
||
|
The figure tag. |
||
|
The font tag. |
||
|
The footer tag. |
||
|
The form tag. |
||
|
The frame tag. |
||
|
The frameset tag. |
||
|
The h1 tag. |
||
|
The h2 tag. |
||
|
The h3 tag. |
||
|
The h4 tag. |
||
|
The h5 tag. |
||
|
The h6 tag. |
||
|
The head tag. |
||
|
The header tag. |
||
|
The hr tag. |
||
|
The html tag. |
||
|
The i tag. |
||
|
The iframe tag. |
||
|
The img tag. |
||
|
The input tag. |
||
|
The ins tag. |
||
|
The isindex tag. |
||
|
The kbd tag. |
||
|
The keygen tag. |
||
|
The label tag. |
||
|
The legend tag. |
||
|
The li tag. |
||
|
The link tag. |
||
|
The listing tag. |
||
|
The main tag. |
||
|
The map tag. |
||
|
The mark tag. |
||
|
The marquee tag. |
||
|
The menu tag. |
||
|
The menuitem tag. |
||
|
The meta tag. |
||
|
The meter tag. |
||
|
The nav tag. |
||
|
The nextid tag. |
||
|
The nobr tag. |
||
|
The noembed tag. |
||
|
The noframes tag. |
||
|
The noscript tag. |
||
|
The object tag. |
||
|
The ol tag. |
||
|
The optgroup tag. |
||
|
The option tag. |
||
|
The output tag. |
||
|
The p tag. |
||
|
The param tag. |
||
|
The plaintext tag. |
||
|
The pre tag. |
||
|
The progress tag. |
||
|
The q tag. |
||
|
The rp tag. |
||
|
The rt tag. |
||
|
The ruby tag. |
||
|
The s tag. |
||
|
The samp tag. |
||
|
The script tag. |
||
|
The section tag. |
||
|
The select tag. |
||
|
The small tag. |
||
|
The source tag. |
||
|
The span tag. |
||
|
The strike tag. |
||
|
The strong tag. |
||
|
The style tag. |
||
|
The sub tag. |
||
|
The summary tag. |
||
|
The sup tag. |
||
|
The table tag. |
||
|
The tbody tag. |
||
|
The td tag. |
||
|
The textarea tag. |
||
|
The tfoot tag. |
||
|
The th tag. |
||
|
The thead tag. |
||
|
The time tag. |
||
|
The title tag. |
||
|
The tr tag. |
||
|
The track tag. |
||
|
The tt tag. |
||
|
The u tag. |
||
|
The ul tag. |
||
|
The var tag. |
||
|
The video tag. |
||
|
The wbr tag. |
||
|
The xml tag. |
||
|
The xmp tag. |
Known attribute names, including legacy HTML attributes. Names are matched without regard to ASCII case.
|
An unrecognized attribute. |
||
|
The abbr attribute. |
||
|
The accept attribute. |
||
|
The accept-charset attribute. |
||
|
The accesskey attribute. |
||
|
The action attribute. |
||
|
The align attribute. |
||
|
The alink attribute. |
||
|
The alt attribute. |
||
|
The archive attribute. |
||
|
The axis attribute. |
||
|
The background attribute. |
||
|
The bgcolor attribute. |
||
|
The border attribute. |
||
|
The cellpadding attribute. |
||
|
The cellspacing attribute. |
||
|
The char attribute. |
||
|
The charoff attribute. |
||
|
The charset attribute. |
||
|
The checked attribute. |
||
|
The cite attribute. |
||
|
The class attribute. |
||
|
The classid attribute. |
||
|
The clear attribute. |
||
|
The code attribute. |
||
|
The codebase attribute. |
||
|
The codetype attribute. |
||
|
The color attribute. |
||
|
The cols attribute. |
||
|
The colspan attribute. |
||
|
The compact attribute. |
||
|
The content attribute. |
||
|
The coords attribute. |
||
|
The data attribute. |
||
|
The datetime attribute. |
||
|
The declare attribute. |
||
|
The defer attribute. |
||
|
The dir attribute. |
||
|
The disabled attribute. |
||
|
The dynsrc attribute. |
||
|
The enctype attribute. |
||
|
The face attribute. |
||
|
The for attribute. |
||
|
The frame attribute. |
||
|
The frameborder attribute. |
||
|
The headers attribute. |
||
|
The height attribute. |
||
|
The href attribute. |
||
|
The hreflang attribute. |
||
|
The hspace attribute. |
||
|
The http-equiv attribute. |
||
|
The id attribute. |
||
|
The ismap attribute. |
||
|
The label attribute. |
||
|
The lang attribute. |
||
|
The language attribute. |
||
|
The leftmargin attribute. |
||
|
The link attribute. |
||
|
The longdesc attribute. |
||
|
The lowsrc attribute. |
||
|
The marginheight attribute. |
||
|
The marginwidth attribute. |
||
|
The maxlength attribute. |
||
|
The media attribute. |
||
|
The method attribute. |
||
|
The multiple attribute. |
||
|
The name attribute. |
||
|
The nohref attribute. |
||
|
The noresize attribute. |
||
|
The noshade attribute. |
||
|
The nowrap attribute. |
||
|
The object attribute. |
||
|
The profile attribute. |
||
|
The prompt attribute. |
||
|
The readonly attribute. |
||
|
The rel attribute. |
||
|
The rev attribute. |
||
|
The rows attribute. |
||
|
The rowspan attribute. |
||
|
The rules attribute. |
||
|
The scheme attribute. |
||
|
The scope attribute. |
||
|
The scrolling attribute. |
||
|
The selected attribute. |
||
|
The shape attribute. |
||
|
The size attribute. |
||
|
The span attribute. |
||
|
The src attribute. |
||
|
The standby attribute. |
||
|
The start attribute. |
||
|
The style attribute. |
||
|
The summary attribute. |
||
|
The tabindex attribute. |
||
|
The target attribute. |
||
|
The text attribute. |
||
|
The title attribute. |
||
|
The topmargin attribute. |
||
|
The type attribute. |
||
|
The usemap attribute. |
||
|
The valign attribute. |
||
|
The value attribute. |
||
|
The valuetype attribute. |
||
|
The version attribute. |
||
|
The vlink attribute. |
||
|
The vspace attribute. |
||
|
The width attribute. |
||
|
The xmlns attribute. |
Namespaces recognized in HTML and foreign content.
Lexical states of the streaming HTML tokenizer.
typedef struct _GMimeHtmlToken GMimeHtmlToken;
An immutable, reference-counted HTML lexical token.