Element
Object Hierarchy:
Description:
A DOM4 implementation of DomElement, for one-step-parsing.
This object avoids pre and post XML parsing, by using a one step parsing to translate text XML tree to an GObject based tree.
A GXml Object Model (GOM) implementation of GXml.Element. It can be used transparently as
DomElement in a XML tree.
It also allows delayed parsing, so you can read large documents by parsing just a XML element node and its attributes but not its
children; save its children as a text, for a post-on-step-parsing.
Content:
Classes:
- Attributes - Holds attributes in current node,
using attribute's name as key and it's value as value. Appends namespace prefix to attribute's name as key if is a namespaced attribute.
Properties:
Creation methods:
Methods:
- public InputStream create_stream () throws Error
Creates an GLib.InputStream to
write a string representation in XML of GXml.Element using node's
GXml.Document
- public async InputStream create_stream_async (Cancellable? cancellable = null) throws Error
Creates an GLib.InputStream to
write a string representation in XML of GXml.Element using node's
GXml.Document
- public string? get_attribute (string name)
- public string? get_attribute_ns (string? namespace_uri, string local_name)
- public DomHTMLCollection get_elements_by_class_name (string class_names)
- public DomHTMLCollection get_elements_by_tag_name (string local_name)
- public DomHTMLCollection get_elements_by_tag_name_ns (string? @namespace, string local_name)
- public bool has_attribute (string name)
- public bool has_attribute_ns (string? namespace_uri, string local_name)
- public void initialize (string local_name)
Convenient function to initialize, at construction time, a
GXml.Element using given local name. If
GXml.Element.initialize_with_namespace has been called in any
base class, this method just change element node's name and keeps previous namespace and prefix.
- public void initialize_document (DomDocument doc, string local_name)
Convenient function to initialize, at construction time, a
GXml.Element using given local name and document.
- public void initialize_document_with_namespace (DomDocument doc, string? namespace_uri, string? prefix, string local_name)
Convenient function to initialize, at construction time, a
GXml.Element using given local name, document and namespace.
- public void initialize_with_namespace (string? namespace_uri, string? prefix, string local_name)
Convenient function to initialize, at construction time, a
GXml.Element using given local name and namespace.
- public string? lookup_namespace_uri (string? prefix)
- public string? lookup_prefix (string? nspace)
- public void parse_buffer () throws Error
- public async void parse_buffer_async () throws Error
- public uint parse_pending ()
Monitor multi-threading parsing
- public DomNodeList query_selector_all (string selectors) throws Error
- public void read_from_file (File f, Cancellable? cancellable = null) throws Error
Parses an XML file, deserializing it over
GXml.Element.
- public async void read_from_file_async (File f, Cancellable? cancellable = null) throws Error
Parses asynchronically an XML file, deserializing it over
GXml.Element.
- public void read_from_stream (InputStream istream, Cancellable? cancellable = null) throws Error
Parses an XML over a GLib.InputStream
, deserializing it over GXml.Element.
- public async void read_from_stream_async (InputStream istream, Cancellable? cancellable = null) throws Error
Parses asynchronically an XML over a
GLib.InputStream, deserializing it over GXml.Element.
- public void read_from_string (string str, Cancellable? cancellable = null) throws Error
Parses an XML string, deserializing it over
GXml.Element.
- public async void read_from_string_async (string str, Cancellable? cancellable = null) throws Error
Parses an XML string, deserializing it over
GXml.Element.
- public void read_unparsed () throws Error
Parse all children, adding them to current node, stored in
unparsed. Once it finish, sets
unparsed to null.
- public void remove ()
- public void remove_attribute (string name)
- public void remove_attribute_ns (string? namespace_uri, string local_name)
- public void set_attribute (string name, string value) throws Error
- public void set_attribute_ns (string? namespace_uri, string name, string value) throws Error
- public void write_file (File f, Cancellable? cancellable = null) throws Error
Uses element's
GXml.Document to write an XML to a file, serializing it.
- public async void write_file_async (File f, Cancellable? cancellable = null) throws Error
Uses element's
GXml.Document to write asynchronically an XML to a file, serializing it.
- public void write_stream (OutputStream stream) throws Error
Uses element's
GXml.Document to write an XML to a stream, serializing it.
- public async void write_stream_async (OutputStream stream, Cancellable? cancellable = null) throws Error
Uses element's
GXml.Document to write an XML to a stream, serializing it.
- public string write_string (Cancellable? cancellable = null) throws Error
Serialize GXml.Element to a string.
- public async string write_string_async (Cancellable? cancellable = null) throws Error
Serialize asynchronically GXml.Element to a
string.
Fields:
Inherited Members:
All known members inherited from class GXml.Node
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.DomChildNode
All known members inherited from interface
GXml.DomNonDocumentTypeChildNode
All known members inherited from interface GXml.DomParentNode
All known members inherited from interface GXml.DomElement
All known members inherited from interface GXml.Object
All known members inherited from interface GXml.DomEventTarget
All known members inherited from interface GXml.DomNode