GXml.Object – GXml-0.20 – Vala Binding Reference

GXml.Object – GXml-0.20 Reference Manual

# Object

## Object Hierarchy:

## Description:

public interface Object : Object, DomNode, DomElement

A GXml Object Model represents a DomElement. It has attributes and children. All object's properties are handled as attributes if they are basic types like integers, strings, enums and others; Property objects are handled as attributes too. If object's attribute is a GLib.Object it is handled as node's child, but only if it is a GXml.Element object, other wise it is ignored when this object is used as DomNode in XML documents.

All known implementing classes:

- Element

Namespace: GXml
Package: GXml-0.20

## Content:

### Methods:

- public virtual void clean_property_elements (string name) throws Error
  Utility method to remove all instances of a property being child elements of object. Is useful if you have a GXml.Element property, it should be just one child of this type and you want to overwrite it.
- public virtual DomElementList find_elements (string name)
  From a given property name of type GXml.Element, search all child nodes with node's local name equal to property.
- public virtual ParamSpec? find_object_property_name (string pname)
  Returns a GXml.Object or a Collection property's GLib.ParamSpec based on given name. This method is case insensitive.
- public virtual Property? find_property (string name)
  Search for a property of type GXml.Property and returns it as object
- public virtual ParamSpec? find_property_name (string nick)
  Returns property's GLib.ParamSpec based on given nick, without '::' This function is case insensitive.
- public virtual string? get_attribute (string name)
  Search for properties in objects, it should be an GLib.Object's property. If found a property with given name its value is returned as string representation.
- public virtual DomElement? get_child (string name)
  Search a GLib.Object property with given name and returns it, if it is a DomElement. If not found, DomElement.get_elements_by_tag_name is called, returning first node found. Tag name to use, is the given name parameter.
- public virtual List<ParamSpec> get_properties_list ()
  Returns a list with all properties' nick with "::" prefix. Nick name, with "::" prefix will be used on serialization to an attribute's name.
- public virtual List<ParamSpec> get_property_element_list ()
  Returns a list of names for all DomElement present as object's properties.
- public virtual string? get_property_string (ParamSpec prop)
  Returns an string representation of an Object's property.
- public virtual bool remove_attribute (string name)
  Search for a property and set it to null if possible returning true, if value can't be removed or located, returns false without change.
- public virtual bool set_attribute (string name, string val)
  Search for a GLib.Object property with given name, if found, given string representation is used as value to property, using any required transformation from string.
- public virtual bool set_instance_property (string name)
  Convenient method to set an instance of given property's name and initialize according to have same DomNode.owner_document and set its DomNode.parent_node to this appending it as a child. If property is a Collection it is initialize to use this as its Collection.element.

### 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

All known members inherited from interface GXml.DomNode

- append_child
- base_uri
- child_nodes
- compare_document_position
- contains
- copy
- first_child
- has_child_nodes
- insert_before

- is_default_namespace
- is_equal_node
- last_child
- lookup_namespace_uri
- lookup_prefix
- next_sibling
- node_name
- node_type
- node_value

- normalize
- owner_document
- parent_element
- parent_node
- previous_sibling
- remove_child
- replace_child
- text_content

All known members inherited from interface GXml.DomElement

- attributes
- class_list
- class_name
- create_stream
- create_stream_async
- get_attribute
- get_attribute_ns
- get_elements_by_class_name
- get_elements_by_tag_name
- get_elements_by_tag_name_ns
- has_attribute
- has_attribute_ns

- id
- local_name
- matches
- namespace_uri
- prefix
- read_from_file
- read_from_file_async
- read_from_stream
- read_from_stream_async
- read_from_string
- read_from_string_async
- read_from_uri

- read_from_uri_async
- remove_attribute
- remove_attribute_ns
- set_attribute
- set_attribute_ns
- tag_name
- write_file
- write_file_async
- write_stream
- write_stream_async
- write_string
- write_string_async