GLib.MarkupParseContext
Description: Reference for GLib.MarkupParseContext

### Struct

# GLibMarkupParseContext

#### Description [src]

    struct GMarkupParseContext {
      /* No available fields */
    }

A parse context is used to parse a stream of bytes that you expect to contain marked-up text.

See g_markup_parse_context_new(), `GMarkupParser`, and so on for more details.

#### Constructors

###### g_markup_parse_context_new

Creates a new parse context. A parse context is used to parse marked-up documents. You can feed any number of documents into a context, as long as no errors occur; once an error occurs, the parse context can’t continue to parse text (you have to free it and create a new parse context).

#### Instance methods

###### g_markup_parse_context_end_parse

Signals to the `GMarkupParseContext` that all data has been fed into the parse context with g_markup_parse_context_parse().

###### g_markup_parse_context_free

Frees a `GMarkupParseContext`.

###### g_markup_parse_context_get_element

Retrieves the name of the currently open element.

since: 2.2

###### g_markup_parse_context_get_element_stack

Retrieves the element stack from the internal state of the parser.

since: 2.16

###### g_markup_parse_context_get_offset

Retrieves the current offset from the beginning of the document, in bytes.

unstable since: 2.88

###### g_markup_parse_context_get_position

Retrieves the current line number and the number of the character on that line. Intended for use in error messages; there are no strict semantics for what constitutes the “current” line number other than “the best number we could come up with for error messages.”.

###### g_markup_parse_context_get_user_data

Returns the user_data associated with `context`.

since: 2.18

###### g_markup_parse_context_parse

Feed some data to the `GMarkupParseContext`.

###### g_markup_parse_context_pop

Completes the process of a temporary sub-parser redirection.

since: 2.18

###### g_markup_parse_context_push

Temporarily redirects markup data to a sub-parser.

since: 2.18

###### g_markup_parse_context_ref

Increases the reference count of `context`.

since: 2.36

###### g_markup_parse_context_unref

Decreases the reference count of `context`. When its reference count drops to 0, it is freed.

since: 2.36