Blame docs/reference/glib/html/glib-Simple-XML-Subset-Parser.html

Packit ae235b
Packit ae235b
<html>
Packit ae235b
<head>
Packit ae235b
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Packit ae235b
<title>Simple XML Subset Parser: GLib Reference Manual</title>
Packit ae235b
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
Packit ae235b
<link rel="home" href="index.html" title="GLib Reference Manual">
Packit ae235b
<link rel="up" href="glib-utilities.html" title="GLib Utilities">
Packit ae235b
<link rel="prev" href="glib-regex-syntax.html" title="Regular expression syntax">
Packit ae235b
<link rel="next" href="glib-Key-value-file-parser.html" title="Key-value file parser">
Packit ae235b
<meta name="generator" content="GTK-Doc V1.27 (XML mode)">
Packit ae235b
<link rel="stylesheet" href="style.css" type="text/css">
Packit ae235b
</head>
Packit ae235b
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
Packit ae235b
Packit ae235b
Packit ae235b
Top  | 
Packit ae235b
                  Description
Packit ae235b
Packit ae235b
Home
Packit ae235b
Up
Packit ae235b
Prev
Packit ae235b
Next
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Simple XML Subset Parser

Packit ae235b

Simple XML Subset Parser — parses a subset of XML

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Functions

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gchar *
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_escape_text ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gchar *
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_printf_escaped ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gchar *
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_vprintf_escaped ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
GMarkupParseContext *
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_parse_context_new ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gboolean
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_parse_context_parse ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gboolean
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_parse_context_end_parse ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
void
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_parse_context_free ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
void
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_parse_context_get_position ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
const gchar *
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_parse_context_get_element ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
const GSList *
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_parse_context_get_element_stack ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gpointer
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_parse_context_get_user_data ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
void
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_parse_context_push ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gpointer
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_parse_context_pop ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
GMarkupParseContext *
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_parse_context_ref ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
void
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_parse_context_unref ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gboolean
Packit ae235b
Packit ae235b
Packit ae235b
g_markup_collect_attributes ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Types and Values

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
enum
Packit ae235b
GMarkupError
Packit ae235b
Packit ae235b
Packit ae235b
#define
Packit ae235b
G_MARKUP_ERROR
Packit ae235b
Packit ae235b
Packit ae235b
enum
Packit ae235b
GMarkupParseFlags
Packit ae235b
Packit ae235b
Packit ae235b
 
Packit ae235b
GMarkupParseContext
Packit ae235b
Packit ae235b
Packit ae235b
struct
Packit ae235b
GMarkupParser
Packit ae235b
Packit ae235b
Packit ae235b
enum
Packit ae235b
GMarkupCollectType
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Includes

Packit ae235b
#include <glib.h>
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Description

Packit ae235b

The "GMarkup" parser is intended to parse a simple markup format

Packit ae235b
that's a subset of XML. This is a small, efficient, easy-to-use
Packit ae235b
parser. It should not be used if you expect to interoperate with
Packit ae235b
other applications generating full-scale XML. However, it's very
Packit ae235b
useful for application data files, config files, etc. where you
Packit ae235b
know your application will be the only one writing the file.
Packit ae235b
Full-scale XML parsers should be able to parse the subset used by
Packit ae235b
GMarkup, so you can easily migrate to full-scale XML at a later
Packit ae235b
time if the need arises.

Packit ae235b

GMarkup is not guaranteed to signal an error on all invalid XML;

Packit ae235b
the parser may accept documents that an XML parser would not.
Packit ae235b
However, XML documents which are not well-formed (which is a
Packit ae235b
weaker condition than being valid. See the
Packit ae235b
XML specification
Packit ae235b
for definitions of these terms.) are not considered valid GMarkup
Packit ae235b
documents.

Packit ae235b

Simplifications to XML include:

Packit ae235b
    Packit ae235b
  • Only UTF-8 encoding is allowed

  • Packit ae235b
  • No user-defined entities

  • Packit ae235b
  • Processing instructions, comments and the doctype declaration

  • Packit ae235b
    are "passed through" but are not interpreted in any way

    Packit ae235b
  • No DTD or validation

  • Packit ae235b
    Packit ae235b

    The markup format does support:

    Packit ae235b
      Packit ae235b
    • Elements

    • Packit ae235b
    • Attributes

    • Packit ae235b
    • 5 standard entities: & < > " '

    • Packit ae235b
    • Character references

    • Packit ae235b
    • Sections marked as CDATA

    • Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Functions

      Packit ae235b
      Packit ae235b

      g_markup_escape_text ()

      Packit ae235b
      gchar *
      Packit ae235b
      g_markup_escape_text (const gchar *text,
      Packit ae235b
                            gssize length);
      Packit ae235b

      Escapes text so that the markup parser will parse it verbatim.

      Packit ae235b
      Less than, greater than, ampersand, etc. are replaced with the
      Packit ae235b
      corresponding entities. This function would typically be used
      Packit ae235b
      when writing out a file to be parsed with the markup parser.

      Packit ae235b

      Note that this function doesn't protect whitespace and line endings

      Packit ae235b
      from being processed according to the XML rules for normalization
      Packit ae235b
      of line endings and attribute values.

      Packit ae235b

      Note also that this function will produce character references in

      Packit ae235b
      the range of &x1; ... &x1f; for all control sequences
      Packit ae235b
      except for tabstop, newline and carriage return.  The character
      Packit ae235b
      references in this range are not valid XML 1.0, but they are
      Packit ae235b
      valid XML 1.1 and will be accepted by the GMarkup parser.

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      text

      Packit ae235b

      some valid UTF-8 text

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      length

      Packit ae235b

      length of text

      Packit ae235b
      in bytes, or -1 if the text is nul-terminated

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Returns

      Packit ae235b

      a newly allocated string with the escaped text

      Packit ae235b
      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      g_markup_printf_escaped ()

      Packit ae235b
      gchar *
      Packit ae235b
      g_markup_printf_escaped (const char *format,
      Packit ae235b
                               ...);
      Packit ae235b

      Formats arguments according to format

      Packit ae235b
      , escaping
      Packit ae235b
      all string and character arguments in the fashion
      Packit ae235b
      of g_markup_escape_text(). This is useful when you
      Packit ae235b
      want to insert literal strings into XML-style markup
      Packit ae235b
      output, without having to worry that the strings
      Packit ae235b
      might themselves contain markup.

      Packit ae235b
      Packit ae235b
        
      Packit ae235b
          
      Packit ae235b
            
      Packit ae235b
              
      1
      Packit ae235b
      2
      Packit ae235b
      3
      Packit ae235b
      4
      Packit ae235b
      5
      Packit ae235b
      6
      Packit ae235b
      7
      Packit ae235b
      8
      Packit ae235b
      9
      Packit ae235b
              
      const char *store = "Fortnum & Mason";
      Packit ae235b
      const char *item = "Tea";
      Packit ae235b
      char *output;
      Packit ae235b
      Packit ae235b
      output = g_markup_printf_escaped ("<purchase>"
      Packit ae235b
                                        "<store>%s</store>"
      Packit ae235b
                                        "<item>%s</item>"
      Packit ae235b
                                        "</purchase>",
      Packit ae235b
                                        store, item);
      Packit ae235b
            
      Packit ae235b
          
      Packit ae235b
        
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      format

      Packit ae235b

      printf() style format string

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      ...

      Packit ae235b

      the arguments to insert in the format string

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Returns

      Packit ae235b

      newly allocated result from formatting

      Packit ae235b
      operation. Free with g_free().

      Packit ae235b
      Packit ae235b

      Since: 2.4

      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      g_markup_vprintf_escaped ()

      Packit ae235b
      gchar *
      Packit ae235b
      g_markup_vprintf_escaped (const char *format,
      Packit ae235b
                                va_list args);
      Packit ae235b

      Formats the data in args

      Packit ae235b
       according to format
      Packit ae235b
      , escaping
      Packit ae235b
      all string and character arguments in the fashion
      Packit ae235b
      of g_markup_escape_text(). See g_markup_printf_escaped().

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      format

      Packit ae235b

      printf() style format string

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      args

      Packit ae235b

      variable argument list, similar to vprintf()

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Returns

      Packit ae235b

      newly allocated result from formatting

      Packit ae235b
      operation. Free with g_free().

      Packit ae235b
      Packit ae235b

      Since: 2.4

      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      g_markup_parse_context_new ()

      Packit ae235b
      GMarkupParseContext *
      Packit ae235b
      g_markup_parse_context_new (const GMarkupParser *parser,
      Packit ae235b
                                  GMarkupParseFlags flags,
      Packit ae235b
                                  gpointer user_data,
      Packit ae235b
                                  GDestroyNotify user_data_dnotify);
      Packit ae235b

      Creates a new parse context. A parse context is used to parse

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

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      parser

      Packit ae235b

      a GMarkupParser

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      flags

      Packit ae235b

      one or more GMarkupParseFlags

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      user_data

      Packit ae235b

      user data to pass to GMarkupParser functions

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      user_data_dnotify

      Packit ae235b

      user data destroy notifier called when

      Packit ae235b
      the parse context is freed

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Returns

      Packit ae235b

      a new GMarkupParseContext

      Packit ae235b
      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      g_markup_parse_context_parse ()

      Packit ae235b
      gboolean
      Packit ae235b
      g_markup_parse_context_parse (GMarkupParseContext *context,
      Packit ae235b
                                    const gchar *text,
      Packit ae235b
                                    gssize text_len,
      Packit ae235b
                                    GError **error);
      Packit ae235b

      Feed some data to the GMarkupParseContext.

      Packit ae235b

      The data need not be valid UTF-8; an error will be signaled if

      Packit ae235b
      it's invalid. The data need not be an entire document; you can
      Packit ae235b
      feed a document into the parser incrementally, via multiple calls
      Packit ae235b
      to this function. Typically, as you receive data from a network
      Packit ae235b
      connection or file, you feed each received chunk of data into this
      Packit ae235b
      function, aborting the process if an error occurs. Once an error
      Packit ae235b
      is reported, no further data may be fed to the GMarkupParseContext;
      Packit ae235b
      all errors are fatal.

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      context

      Packit ae235b

      a GMarkupParseContext

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      text

      Packit ae235b

      chunk of text to parse

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      text_len

      Packit ae235b

      length of text

      Packit ae235b
      in bytes

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      error

      Packit ae235b

      return location for a GError

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Returns

      Packit ae235b

      FALSE if an error occurred, TRUE on success

      Packit ae235b
      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      g_markup_parse_context_end_parse ()

      Packit ae235b
      gboolean
      Packit ae235b
      g_markup_parse_context_end_parse (GMarkupParseContext *context,
      Packit ae235b
                                        GError **error);
      Packit ae235b

      Signals to the GMarkupParseContext that all data has been

      Packit ae235b
      fed into the parse context with g_markup_parse_context_parse().

      Packit ae235b

      This function reports an error if the document isn't complete,

      Packit ae235b
      for example if elements are still open.

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      context

      Packit ae235b

      a GMarkupParseContext

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      error

      Packit ae235b

      return location for a GError

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Returns

      Packit ae235b

      TRUE on success, FALSE if an error was set

      Packit ae235b
      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      g_markup_parse_context_free ()

      Packit ae235b
      void
      Packit ae235b
      g_markup_parse_context_free (GMarkupParseContext *context);
      Packit ae235b

      Frees a GMarkupParseContext.

      Packit ae235b

      This function can't be called from inside one of the

      Packit ae235b
      GMarkupParser functions or while a subparser is pushed.

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      context

      Packit ae235b

      a GMarkupParseContext

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      g_markup_parse_context_get_position ()

      Packit ae235b
      void
      Packit ae235b
      g_markup_parse_context_get_position (GMarkupParseContext *context,
      Packit ae235b
                                           gint *line_number,
      Packit ae235b
                                           gint *char_number);
      Packit ae235b

      Retrieves the current line number and the number of the character on

      Packit ae235b
      that line. Intended for use in error messages; there are no strict
      Packit ae235b
      semantics for what constitutes the "current" line number other than
      Packit ae235b
      "the best number we could come up with for error messages."

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      context

      Packit ae235b

      a GMarkupParseContext

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      line_number

      Packit ae235b

      return location for a line number, or NULL.

      Packit ae235b
      [nullable]
      Packit ae235b
      Packit ae235b
      Packit ae235b

      char_number

      Packit ae235b

      return location for a char-on-line number, or NULL.

      Packit ae235b
      [nullable]
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      g_markup_parse_context_get_element ()

      Packit ae235b
      const gchar *
      Packit ae235b
      g_markup_parse_context_get_element (GMarkupParseContext *context);
      Packit ae235b

      Retrieves the name of the currently open element.

      Packit ae235b

      If called from the start_element or end_element handlers this will

      Packit ae235b
      give the element_name as passed to those functions. For the parent
      Packit ae235b
      elements, see g_markup_parse_context_get_element_stack().

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      context

      Packit ae235b

      a GMarkupParseContext

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Returns

      Packit ae235b

      the name of the currently open element, or NULL

      Packit ae235b
      Packit ae235b

      Since: 2.2

      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      g_markup_parse_context_get_element_stack ()

      Packit ae235b
      const GSList *
      Packit ae235b
      g_markup_parse_context_get_element_stack
      Packit ae235b
                                     (GMarkupParseContext *context);
      Packit ae235b

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

      Packit ae235b

      The returned GSList is a list of strings where the first item is

      Packit ae235b
      the currently open tag (as would be returned by
      Packit ae235b
      g_markup_parse_context_get_element()) and the next item is its
      Packit ae235b
      immediate parent.

      Packit ae235b

      This function is intended to be used in the start_element and

      Packit ae235b
      end_element handlers where g_markup_parse_context_get_element()
      Packit ae235b
      would merely return the name of the element that is being
      Packit ae235b
      processed.

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      context

      Packit ae235b

      a GMarkupParseContext

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Returns

      Packit ae235b

      the element stack, which must not be modified

      Packit ae235b
      Packit ae235b

      Since: 2.16

      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      g_markup_parse_context_get_user_data ()

      Packit ae235b
      gpointer
      Packit ae235b
      g_markup_parse_context_get_user_data (GMarkupParseContext *context);
      Packit ae235b

      Returns the user_data associated with context

      Packit ae235b
      .

      Packit ae235b

      This will either be the user_data that was provided to

      Packit ae235b
      g_markup_parse_context_new() or to the most recent call
      Packit ae235b
      of g_markup_parse_context_push().

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      context

      Packit ae235b

      a GMarkupParseContext

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Returns

      Packit ae235b

      the provided user_data. The returned data belongs to

      Packit ae235b
      the markup context and will be freed when
      Packit ae235b
      g_markup_parse_context_free() is called.

      Packit ae235b
      Packit ae235b

      Since: 2.18

      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      g_markup_parse_context_push ()

      Packit ae235b
      void
      Packit ae235b
      g_markup_parse_context_push (GMarkupParseContext *context,
      Packit ae235b
                                   const GMarkupParser *parser,
      Packit ae235b
                                   gpointer user_data);
      Packit ae235b

      Temporarily redirects markup data to a sub-parser.

      Packit ae235b

      This function may only be called from the start_element handler of

      Packit ae235b
      a GMarkupParser. It must be matched with a corresponding call to
      Packit ae235b
      g_markup_parse_context_pop() in the matching end_element handler
      Packit ae235b
      (except in the case that the parser aborts due to an error).

      Packit ae235b

      All tags, text and other data between the matching tags is

      Packit ae235b
      redirected to the subparser given by parser
      Packit ae235b
      . user_data
      Packit ae235b
       is used
      Packit ae235b
      as the user_data for that parser. user_data
      Packit ae235b
       is also passed to the
      Packit ae235b
      error callback in the event that an error occurs. This includes
      Packit ae235b
      errors that occur in subparsers of the subparser.

      Packit ae235b

      The end tag matching the start tag for which this call was made is

      Packit ae235b
      handled by the previous parser (which is given its own user_data)
      Packit ae235b
      which is why g_markup_parse_context_pop() is provided to allow "one
      Packit ae235b
      last access" to the user_data
      Packit ae235b
       provided to this function. In the
      Packit ae235b
      case of error, the user_data
      Packit ae235b
       provided here is passed directly to
      Packit ae235b
      the error callback of the subparser and g_markup_parse_context_pop()
      Packit ae235b
      should not be called. In either case, if user_data
      Packit ae235b
       was allocated
      Packit ae235b
      then it ought to be freed from both of these locations.

      Packit ae235b

      This function is not intended to be directly called by users

      Packit ae235b
      interested in invoking subparsers. Instead, it is intended to be
      Packit ae235b
      used by the subparsers themselves to implement a higher-level
      Packit ae235b
      interface.

      Packit ae235b

      As an example, see the following implementation of a simple

      Packit ae235b
      parser that counts the number of tags encountered.

      Packit ae235b
      Packit ae235b
        
      Packit ae235b
          
      Packit ae235b
            
      Packit ae235b
              
      1
      Packit ae235b
      2
      Packit ae235b
      3
      Packit ae235b
      4
      Packit ae235b
      5
      Packit ae235b
      6
      Packit ae235b
      7
      Packit ae235b
      8
      Packit ae235b
      9
      Packit ae235b
      10
      Packit ae235b
      11
      Packit ae235b
      12
      Packit ae235b
      13
      Packit ae235b
      14
      Packit ae235b
      15
      Packit ae235b
      16
      Packit ae235b
      17
      Packit ae235b
      18
      Packit ae235b
      19
      Packit ae235b
      20
      Packit ae235b
      21
      Packit ae235b
      22
      Packit ae235b
      23
      Packit ae235b
      24
      Packit ae235b
      25
      Packit ae235b
      26
      Packit ae235b
      27
      Packit ae235b
      28
      Packit ae235b
      29
      Packit ae235b
      30
      Packit ae235b
      31
      Packit ae235b
      32
      Packit ae235b
      33
      Packit ae235b
      34
      Packit ae235b
      35
      Packit ae235b
      36
      Packit ae235b
              
      typedef struct
      Packit ae235b
      {
      Packit ae235b
        gint tag_count;
      Packit ae235b
      } CounterData;
      Packit ae235b
      Packit ae235b
      static void
      Packit ae235b
      counter_start_element (GMarkupParseContext  *context,
      Packit ae235b
                             const gchar          *element_name,
      Packit ae235b
                             const gchar         **attribute_names,
      Packit ae235b
                             const gchar         **attribute_values,
      Packit ae235b
                             gpointer              user_data,
      Packit ae235b
                             GError              **error)
      Packit ae235b
      {
      Packit ae235b
        CounterData *data = user_data;
      Packit ae235b
      Packit ae235b
        data->tag_count++;
      Packit ae235b
      }
      Packit ae235b
      Packit ae235b
      static void
      Packit ae235b
      counter_error (GMarkupParseContext *context,
      Packit ae235b
                     GError              *error,
      Packit ae235b
                     gpointer             user_data)
      Packit ae235b
      {
      Packit ae235b
        CounterData *data = user_data;
      Packit ae235b
      Packit ae235b
        g_slice_free (CounterData, data);
      Packit ae235b
      }
      Packit ae235b
      Packit ae235b
      static GMarkupParser counter_subparser =
      Packit ae235b
      {
      Packit ae235b
        counter_start_element,
      Packit ae235b
        NULL,
      Packit ae235b
        NULL,
      Packit ae235b
        NULL,
      Packit ae235b
        counter_error
      Packit ae235b
      };
      Packit ae235b
            
      Packit ae235b
          
      Packit ae235b
        
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Packit ae235b

      In order to allow this parser to be easily used as a subparser, the

      Packit ae235b
      following interface is provided:

      Packit ae235b
      Packit ae235b
        
      Packit ae235b
          
      Packit ae235b
            
      Packit ae235b
              
      1
      Packit ae235b
      2
      Packit ae235b
      3
      Packit ae235b
      4
      Packit ae235b
      5
      Packit ae235b
      6
      Packit ae235b
      7
      Packit ae235b
      8
      Packit ae235b
      9
      Packit ae235b
      10
      Packit ae235b
      11
      Packit ae235b
      12
      Packit ae235b
      13
      Packit ae235b
      14
      Packit ae235b
      15
      Packit ae235b
      16
      Packit ae235b
      17
      Packit ae235b
      18
      Packit ae235b
      19
      Packit ae235b
      20
      Packit ae235b
              
      void
      Packit ae235b
      start_counting (GMarkupParseContext *context)
      Packit ae235b
      {
      Packit ae235b
        CounterData *data = g_slice_new (CounterData);
      Packit ae235b
      Packit ae235b
        data->tag_count = 0;
      Packit ae235b
        g_markup_parse_context_push (context, &counter_subparser, data);
      Packit ae235b
      }
      Packit ae235b
      Packit ae235b
      gint
      Packit ae235b
      end_counting (GMarkupParseContext *context)
      Packit ae235b
      {
      Packit ae235b
        CounterData *data = g_markup_parse_context_pop (context);
      Packit ae235b
        int result;
      Packit ae235b
      Packit ae235b
        result = data->tag_count;
      Packit ae235b
        g_slice_free (CounterData, data);
      Packit ae235b
      Packit ae235b
        return result;
      Packit ae235b
      }
      Packit ae235b
            
      Packit ae235b
          
      Packit ae235b
        
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Packit ae235b

      The subparser would then be used as follows:

      Packit ae235b
      Packit ae235b
        
      Packit ae235b
          
      Packit ae235b
            
      Packit ae235b
              
      1
      Packit ae235b
      2
      Packit ae235b
      3
      Packit ae235b
      4
      Packit ae235b
      5
      Packit ae235b
      6
      Packit ae235b
      7
      Packit ae235b
      8
      Packit ae235b
      9
      Packit ae235b
      10
      Packit ae235b
      11
      Packit ae235b
      12
      Packit ae235b
      13
      Packit ae235b
      14
      Packit ae235b
      15
      Packit ae235b
              
      static void start_element (context, element_name, ...)
      Packit ae235b
      {
      Packit ae235b
        if (strcmp (element_name, "count-these") == 0)
      Packit ae235b
          start_counting (context);
      Packit ae235b
      Packit ae235b
        // else, handle other tags...
      Packit ae235b
      }
      Packit ae235b
      Packit ae235b
      static void end_element (context, element_name, ...)
      Packit ae235b
      {
      Packit ae235b
        if (strcmp (element_name, "count-these") == 0)
      Packit ae235b
          g_print ("Counted %d tags\n", end_counting (context));
      Packit ae235b
      Packit ae235b
        // else, handle other tags...
      Packit ae235b
      }
      Packit ae235b
            
      Packit ae235b
          
      Packit ae235b
        
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      context

      Packit ae235b

      a GMarkupParseContext

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      parser

      Packit ae235b

      a GMarkupParser

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      user_data

      Packit ae235b

      user data to pass to GMarkupParser functions

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Since: 2.18

      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      g_markup_parse_context_pop ()

      Packit ae235b
      gpointer
      Packit ae235b
      g_markup_parse_context_pop (GMarkupParseContext *context);
      Packit ae235b

      Completes the process of a temporary sub-parser redirection.

      Packit ae235b

      This function exists to collect the user_data allocated by a

      Packit ae235b
      matching call to g_markup_parse_context_push(). It must be called
      Packit ae235b
      in the end_element handler corresponding to the start_element
      Packit ae235b
      handler during which g_markup_parse_context_push() was called.
      Packit ae235b
      You must not call this function from the error callback -- the
      Packit ae235b
      user_data
      Packit ae235b
       is provided directly to the callback in that case.

      Packit ae235b

      This function is not intended to be directly called by users

      Packit ae235b
      interested in invoking subparsers. Instead, it is intended to
      Packit ae235b
      be used by the subparsers themselves to implement a higher-level
      Packit ae235b
      interface.

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      context

      Packit ae235b

      a GMarkupParseContext

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Returns

      Packit ae235b

      the user data passed to g_markup_parse_context_push()

      Packit ae235b
      Packit ae235b

      Since: 2.18

      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      g_markup_parse_context_ref ()

      Packit ae235b
      GMarkupParseContext *
      Packit ae235b
      g_markup_parse_context_ref (GMarkupParseContext *context);
      Packit ae235b

      Increases the reference count of context

      Packit ae235b
      .

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      context

      Packit ae235b

      a GMarkupParseContext

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Returns

      Packit ae235b

      the same context

      Packit ae235b

      Packit ae235b
      Packit ae235b

      Since: 2.36

      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      g_markup_parse_context_unref ()

      Packit ae235b
      void
      Packit ae235b
      g_markup_parse_context_unref (GMarkupParseContext *context);
      Packit ae235b

      Decreases the reference count of context

      Packit ae235b
      .  When its reference count
      Packit ae235b
      drops to 0, it is freed.

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      context

      Packit ae235b

      a GMarkupParseContext

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Since: 2.36

      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      g_markup_collect_attributes ()

      Packit ae235b
      gboolean
      Packit ae235b
      g_markup_collect_attributes (const gchar *element_name,
      Packit ae235b
                                   const gchar **attribute_names,
      Packit ae235b
                                   const gchar **attribute_values,
      Packit ae235b
                                   GError **error,
      Packit ae235b
                                   GMarkupCollectType first_type,
      Packit ae235b
                                   const gchar *first_attr,
      Packit ae235b
                                   ...);
      Packit ae235b

      Collects the attributes of the element from the data passed to the

      Packit ae235b
      GMarkupParser start_element function, dealing with common error
      Packit ae235b
      conditions and supporting boolean values.

      Packit ae235b

      This utility function is not required to write a parser but can save

      Packit ae235b
      a lot of typing.

      Packit ae235b

      The element_name

      Packit ae235b
      , attribute_names
      Packit ae235b
      , attribute_values
      Packit ae235b
       and error
      Packit ae235b
      Packit ae235b
      parameters passed to the start_element callback should be passed
      Packit ae235b
      unmodified to this function.

      Packit ae235b

      Following these arguments is a list of "supported" attributes to collect.

      Packit ae235b
      It is an error to specify multiple attributes with the same name. If any
      Packit ae235b
      attribute not in the list appears in the attribute_names
      Packit ae235b
       array then an
      Packit ae235b
      unknown attribute error will result.

      Packit ae235b

      The GMarkupCollectType field allows specifying the type of collection

      Packit ae235b
      to perform and if a given attribute must appear or is optional.

      Packit ae235b

      The attribute name is simply the name of the attribute to collect.

      Packit ae235b

      The pointer should be of the appropriate type (see the descriptions

      Packit ae235b
      under GMarkupCollectType) and may be NULL in case a particular
      Packit ae235b
      attribute is to be allowed but ignored.

      Packit ae235b

      This function deals with issuing errors for missing attributes

      Packit ae235b
      (of type G_MARKUP_ERROR_MISSING_ATTRIBUTE), unknown attributes
      Packit ae235b
      (of type G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE) and duplicate
      Packit ae235b
      attributes (of type G_MARKUP_ERROR_INVALID_CONTENT) as well
      Packit ae235b
      as parse errors for boolean-valued attributes (again of type
      Packit ae235b
      G_MARKUP_ERROR_INVALID_CONTENT). In all of these cases FALSE
      Packit ae235b
      will be returned and error
      Packit ae235b
       will be set as appropriate.

      Packit ae235b
      Packit ae235b

      Parameters

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      element_name

      Packit ae235b

      the current tag name

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      attribute_names

      Packit ae235b

      the attribute names

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      attribute_values

      Packit ae235b

      the attribute values

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      error

      Packit ae235b

      a pointer to a GError or NULL

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      first_type

      Packit ae235b

      the GMarkupCollectType of the first attribute

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      first_attr

      Packit ae235b

      the name of the first attribute

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      ...

      Packit ae235b

      a pointer to the storage location of the first attribute

      Packit ae235b
      (or NULL), followed by more types names and pointers, ending
      Packit ae235b
      with G_MARKUP_COLLECT_INVALID

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Returns

      Packit ae235b

      TRUE if successful

      Packit ae235b
      Packit ae235b

      Since: 2.16

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Types and Values

      Packit ae235b
      Packit ae235b

      enum GMarkupError

      Packit ae235b

      Error codes returned by markup parsing.

      Packit ae235b
      Packit ae235b

      Members

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_ERROR_BAD_UTF8

      Packit ae235b
      Packit ae235b

      text being parsed was not valid UTF-8

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_ERROR_EMPTY

      Packit ae235b
      Packit ae235b

      document contained nothing, or only whitespace

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_ERROR_PARSE

      Packit ae235b
      Packit ae235b

      document was ill-formed

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_ERROR_UNKNOWN_ELEMENT

      Packit ae235b
      Packit ae235b

      error should be set by GMarkupParser

      Packit ae235b
          functions; element wasn't known

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE

      Packit ae235b
      Packit ae235b

      error should be set by GMarkupParser

      Packit ae235b
          functions; attribute wasn't known

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_ERROR_INVALID_CONTENT

      Packit ae235b
      Packit ae235b

      error should be set by GMarkupParser

      Packit ae235b
          functions; content was invalid

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_ERROR_MISSING_ATTRIBUTE

      Packit ae235b
      Packit ae235b

      error should be set by GMarkupParser

      Packit ae235b
          functions; a required attribute was missing

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      G_MARKUP_ERROR

      Packit ae235b
      #define G_MARKUP_ERROR g_markup_error_quark ()
      Packit ae235b
      Packit ae235b

      Error domain for markup parsing.

      Packit ae235b
      Errors in this domain will be from the GMarkupError enumeration.
      Packit ae235b
      See GError for information on error domains.

      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      enum GMarkupParseFlags

      Packit ae235b

      Flags that affect the behaviour of the parser.

      Packit ae235b
      Packit ae235b

      Members

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG

      Packit ae235b
      Packit ae235b

      flag you should not use

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_TREAT_CDATA_AS_TEXT

      Packit ae235b
      Packit ae235b

      When this flag is set, CDATA marked

      Packit ae235b
          sections are not passed literally to the passthrough
      Packit ae235b
       function of
      Packit ae235b
          the parser. Instead, the content of the section (without the
      Packit ae235b
          &lt;![CDATA[ and ]]&gt;) is
      Packit ae235b
          passed to the text
      Packit ae235b
       function. This flag was added in GLib 2.12

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_PREFIX_ERROR_POSITION

      Packit ae235b
      Packit ae235b

      Normally errors caught by GMarkup

      Packit ae235b
          itself have line/column information prefixed to them to let the
      Packit ae235b
          caller know the location of the error. When this flag is set the
      Packit ae235b
          location information is also prefixed to errors generated by the
      Packit ae235b
          GMarkupParser implementation functions

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_IGNORE_QUALIFIED

      Packit ae235b
      Packit ae235b

      Ignore (don't report) qualified

      Packit ae235b
          attributes and tags, along with their contents.  A qualified
      Packit ae235b
          attribute or tag is one that contains ':' in its name (ie: is in
      Packit ae235b
          another namespace).  Since: 2.40.

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      GMarkupParseContext

      Packit ae235b
      typedef struct _GMarkupParseContext GMarkupParseContext;
      Packit ae235b

      A parse context is used to parse a stream of bytes that

      Packit ae235b
      you expect to contain marked-up text.

      Packit ae235b

      See g_markup_parse_context_new(), GMarkupParser, and so

      Packit ae235b
      on for more details.

      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      struct GMarkupParser

      Packit ae235b
      struct GMarkupParser {
      Packit ae235b
        /* Called for open tags <foo bar="baz"> */
      Packit ae235b
        void (*start_element)  (GMarkupParseContext *context,
      Packit ae235b
                                const gchar         *element_name,
      Packit ae235b
                                const gchar        **attribute_names,
      Packit ae235b
                                const gchar        **attribute_values,
      Packit ae235b
                                gpointer             user_data,
      Packit ae235b
                                GError             **error);
      Packit ae235b
      Packit ae235b
        /* Called for close tags </foo> */
      Packit ae235b
        void (*end_element)    (GMarkupParseContext *context,
      Packit ae235b
                                const gchar         *element_name,
      Packit ae235b
                                gpointer             user_data,
      Packit ae235b
                                GError             **error);
      Packit ae235b
      Packit ae235b
        /* Called for character data */
      Packit ae235b
        /* text is not nul-terminated */
      Packit ae235b
        void (*text)           (GMarkupParseContext *context,
      Packit ae235b
                                const gchar         *text,
      Packit ae235b
                                gsize                text_len,
      Packit ae235b
                                gpointer             user_data,
      Packit ae235b
                                GError             **error);
      Packit ae235b
      Packit ae235b
        /* Called for strings that should be re-saved verbatim in this same
      Packit ae235b
         * position, but are not otherwise interpretable.  At the moment
      Packit ae235b
         * this includes comments and processing instructions.
      Packit ae235b
         */
      Packit ae235b
        /* text is not nul-terminated. */
      Packit ae235b
        void (*passthrough)    (GMarkupParseContext *context,
      Packit ae235b
                                const gchar         *passthrough_text,
      Packit ae235b
                                gsize                text_len,
      Packit ae235b
                                gpointer             user_data,
      Packit ae235b
                                GError             **error);
      Packit ae235b
      Packit ae235b
        /* Called on error, including one set by other
      Packit ae235b
         * methods in the vtable. The GError should not be freed.
      Packit ae235b
         */
      Packit ae235b
        void (*error)          (GMarkupParseContext *context,
      Packit ae235b
                                GError              *error,
      Packit ae235b
                                gpointer             user_data);
      Packit ae235b
      };
      Packit ae235b
      Packit ae235b

      Any of the fields in GMarkupParser can be NULL, in which case they

      Packit ae235b
      will be ignored. Except for the error
      Packit ae235b
       function, any of these callbacks
      Packit ae235b
      can set an error; in particular the G_MARKUP_ERROR_UNKNOWN_ELEMENT,
      Packit ae235b
      G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, and G_MARKUP_ERROR_INVALID_CONTENT
      Packit ae235b
      errors are intended to be set from these callbacks. If you set an error
      Packit ae235b
      from a callback, g_markup_parse_context_parse() will report that error
      Packit ae235b
      back to its caller.

      Packit ae235b
      Packit ae235b

      Members

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      start_element ()

      Packit ae235b

      Callback to invoke when the opening tag of an element

      Packit ae235b
      is seen. The callback's attribute_names
      Packit ae235b
      and attribute_values
      Packit ae235b
      parameters
      Packit ae235b
      are NULL-terminated.

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      end_element ()

      Packit ae235b

      Callback to invoke when the closing tag of an element

      Packit ae235b
      is seen. Note that this is also called for empty tags like
      Packit ae235b
      &lt;empty/>.

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      text ()

      Packit ae235b

      Callback to invoke when some text is seen (text is always

      Packit ae235b
      inside an element). Note that the text of an element may be spread
      Packit ae235b
      over multiple calls of this function. If the
      Packit ae235b
      G_MARKUP_TREAT_CDATA_AS_TEXT flag is set, this function is also
      Packit ae235b
      called for the content of CDATA marked sections.

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      passthrough ()

      Packit ae235b

      Callback to invoke for comments, processing instructions

      Packit ae235b
      and doctype declarations; if you're re-writing the parsed document,
      Packit ae235b
      write the passthrough text back out in the same position. If the
      Packit ae235b
      G_MARKUP_TREAT_CDATA_AS_TEXT flag is not set, this function is also
      Packit ae235b
      called for CDATA marked sections.

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      error ()

      Packit ae235b

      Callback to invoke when an error occurs.

      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Packit ae235b
      Packit ae235b

      enum GMarkupCollectType

      Packit ae235b

      A mixed enumerated type and flags field. You must specify one type

      Packit ae235b
      (string, strdup, boolean, tristate).  Additionally, you may  optionally
      Packit ae235b
      bitwise OR the type with the flag G_MARKUP_COLLECT_OPTIONAL.

      Packit ae235b

      It is likely that this enum will be extended in the future to

      Packit ae235b
      support other types.

      Packit ae235b
      Packit ae235b

      Members

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_COLLECT_INVALID

      Packit ae235b
      Packit ae235b

      used to terminate the list of attributes

      Packit ae235b
          to collect

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_COLLECT_STRING

      Packit ae235b
      Packit ae235b

      collect the string pointer directly from

      Packit ae235b
          the attribute_values[] array. Expects a parameter of type (const
      Packit ae235b
          char **). If G_MARKUP_COLLECT_OPTIONAL is specified and the
      Packit ae235b
          attribute isn't present then the pointer will be set to NULL

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_COLLECT_STRDUP

      Packit ae235b
      Packit ae235b

      as with G_MARKUP_COLLECT_STRING, but

      Packit ae235b
          expects a parameter of type (char **) and g_strdup()s the
      Packit ae235b
          returned pointer. The pointer must be freed with g_free()

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_COLLECT_BOOLEAN

      Packit ae235b
      Packit ae235b

      expects a parameter of type (gboolean *)

      Packit ae235b
          and parses the attribute value as a boolean. Sets FALSE if the
      Packit ae235b
          attribute isn't present. Valid boolean values consist of
      Packit ae235b
          (case-insensitive) "false", "f", "no", "n", "0" and "true", "t",
      Packit ae235b
          "yes", "y", "1"

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_COLLECT_TRISTATE

      Packit ae235b
      Packit ae235b

      as with G_MARKUP_COLLECT_BOOLEAN, but

      Packit ae235b
          in the case of a missing attribute a value is set that compares
      Packit ae235b
          equal to neither FALSE nor TRUE G_MARKUP_COLLECT_OPTIONAL is
      Packit ae235b
          implied

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b

      G_MARKUP_COLLECT_OPTIONAL

      Packit ae235b
      Packit ae235b

      can be bitwise ORed with the other fields.

      Packit ae235b
          If present, allows the attribute not to appear. A default value
      Packit ae235b
          is set depending on what value type is used

      Packit ae235b
      Packit ae235b
       
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      See Also

      Packit ae235b

      XML Specification

      Packit ae235b
      Packit ae235b
      Packit ae235b
      Packit ae235b

      Generated by GTK-Doc V1.27
      Packit ae235b
      </body>
      Packit ae235b
      </html>