GXml.Parser – GXml-0.20 Reference Manual

# Parser

## Object Hierarchy:

## Description:

public interface Parser : Object

XML parser engine for DomDocument implementations.

All known implementing classes:

- XParser

Namespace: GXml
Package: GXml-0.20

## Content:

### Properties:

- public abstract bool backup { get; set; }
  Controls if, when writing to a file, a backup should be created.
- public abstract Cancellable? cancellable { get; set; }
  Controls if, when writing, indentation should be used.
- public abstract bool indent { get; set; }
  Controls if, when writing, indentation should be used.
- public abstract DomNode node { get; }
  A GXml.DomDocument to read to or write from
- public abstract HashTable<Type,HashTable<string,Type>> types { get; }
  A collection of child types of found GXml.CollectionParent objects, used to instantiate the correct class based on the node's name.

### Methods:

- public virtual bool add_element_collection (DomNode parent, out DomNode element) throws Error
  Creates a new DomElement and append it as a child of parent: for current read node, only if parent: have a property as Collection type and current node have same local name as collection Collection.items_name
- public abstract DomElement? create_element (DomNode parent) throws Error
  Creates a new DomElement and append it as a child of parent.
- public abstract InputStream create_stream () throws Error
  Creates an GLib.InputStream to write a string representation in XML
- public abstract async InputStream create_stream_async () throws Error
  Creates asyncronically an GLib.InputStream to write a string representation in XML
- public abstract bool current_is_document ()
  Check if current node found by parser, is a DomDocument
- public abstract bool current_is_element ()
  Check if current node found by parser, is a DomElement
- public abstract bool current_is_empty_element ()
  Check if current node has children.
- public abstract string current_node_name ()
  Returns current node's local name, found by parser.
- public abstract bool move_next_node () throws Error
  Use parser to go to next parsed node.
- public virtual bool read_child_element (DomNode parent) throws Error
  Reads current found element
- public abstract bool read_child_node (DomNode parent) throws Error
  Creates a new DomNode and append it to parent: depending on current node's type found by parser.
- public virtual void read_child_nodes (DomNode parent) throws Error
  Iterates in all child nodes and append them to node.
- public virtual async void read_child_nodes_async (DomNode parent) throws Error
  Iterates in all child nodes and append them to node.
- public abstract void read_child_nodes_stream (InputStream istream) throws Error
  Read all children node feed by stream.
- public virtual void read_child_nodes_string (string str) throws Error
  Read children nodes from string
- public abstract void read_element (DomElement element) throws Error
  Reads an element's attributes, setting its values and taking care about their namespaces.
- public virtual bool read_element_property (DomNode parent, out DomNode element) throws Error
  Creates a new DomElement and append it as a child of parent: for current read node, only if parent: have a property as DomElement type and current node have same local name as property element.
- public virtual void read_file (File file) throws Error
  Reads a node from a GLib.File
- public virtual async void read_file_async (File file) throws Error
  Reads a GXml.DomDocument from a GLib.File
- public abstract void read_stream (InputStream stream) throws Error
  Read a GXml.DomDocument from a GLib.InputStream
- public abstract async void read_stream_async (InputStream stream) throws Error
  Read a GXml.DomDocument from a GLib.InputStream
- public abstract void read_string (string str) throws Error
  Reads a node from a string
- public abstract async void read_string_async (string str) throws Error
  Reads synchronically node a from a string
- public abstract string read_unparsed () throws Error
  Reads all child nodes as string
- public virtual void write_file (File file) throws Error
  Writes a GXml.DomDocument to a GLib.File
- public virtual async void write_file_async (File file) throws Error
  Writes a GXml.DomDocument to a GLib.File
- public abstract void write_stream (OutputStream stream) throws Error
  Writes a GXml.DomDocument to a GLib.OutputStream
- public abstract async void write_stream_async (OutputStream stream) throws Error
  Writes asynchronically a node to a GLib.OutputStream
- public abstract string write_string () throws Error
  Writes a node to a string
- public abstract async string write_string_async () throws Error
  Writes asynchronically node to a string

### Inherited Members:

All known members inherited from class GLib.Object

- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data

- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer

- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref