GXml.XDocument – GXml-0.20 Reference Manual

# XDocument

## Object Hierarchy:

## Description:

public class XDocument : XNode, DomParentNode, DomNonElementParentNode, DomDocument, DomXMLDocument, XPathContext

DOM4 class implementing GXml.DomDocument and {GXml.DomDocument} interface, powered by libxml-2.0 library.

This class use Xml.TextWriter to write down XML documents using its contained GXml.DomNode children or other XML structures.

All known sub-classes:

- XHtmlDocument

Namespace: GXml
Package: GXml-0.20

## Content:

### Properties:

- public override Map<string,DomNode> attrs { owned get; }
- public bool backup { get; set; }
- public string character_set { get; }
- public int child_element_count { get; }
- public DomHTMLCollection children { owned get; }
- public override BidirList<DomNode> children_nodes { owned get; }
- public string compat_mode { get; }
- public string content_type { get; }
- public DomDocumentType? doctype { owned get; }
- public override DomDocument document { get; }
- public DomElement? document_element { owned get; }
- public string document_uri { get; }
- public File file { get; set; }
- public DomElement? first_element_child { owned get; }
- public DomImplementation implementation { get; }
- public bool indent { get; set; }
- public DomElement? last_element_child { owned get; }
- public bool ns_top { get; set; }
- public string origin { get; }
- public bool prefix_default_ns { get; set; }
- public DomNode root { owned get; }
- public string url { get; }

### Creation methods:

- public XDocument ()
- public XDocument.from_doc (Doc doc)
  Gigen Xml.Doc is owned by this
- public XDocument.from_file (File file, int options = 0, Cancellable? cancel = null) throws Error
- public XDocument.from_path (string path, int options = 0) throws Error
- public XDocument.from_stream (InputStream istream) throws Error
- public XDocument.from_string (string str, int options = 0) throws Error
- public XDocument.from_uri (string uri, int options = 0) throws Error

### Methods:

- public DomNode adopt_node (DomNode node) throws Error
- public DomComment create_comment (string data) throws Error
- public DomDocumentFragment create_document_fragment ()
- public DomElement create_element (string local_name) throws Error
- public DomElement create_element_ns (string? ns, string qualified_name) throws Error
- public DomEvent create_event (string iface)
- public DomNodeIterator create_node_iterator (DomNode root, int what_to_show = ( int)0xFFFFFFFF)
- public DomNode create_pi (string target, string data)
- public DomProcessingInstruction create_processing_instruction (string target, string data) throws Error
- public DomRange create_range ()
- public DomNode create_text (string text)
- public DomText create_text_node (string data) throws Error
- public DomTreeWalker create_tree_walker (DomNode root, int what_to_show = ( int)0xFFFFFFFF)
- public XPathObject evaluate (string expression, Map<string,string>? resolver = null) throws XPathObjectError
  XPathContext implementation.
- public DomElement? get_element_by_id (string element_id) throws Error
- 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? ns, string local_name)
- public Parser get_xml_parser ()
- public DomNode import_node (DomNode node, bool deep = false) throws Error
- public string libxml_to_string ()
  Uses libxml2 internal dump to memory function over owned
- public DomNodeList query_selector_all (string selectors) throws Error
- public virtual bool save (Cancellable? cancellable = null) throws Error
- public virtual bool save_as (File f, Cancellable? cancellable = null) throws Error
- public override bool set_namespace (string uri, string? prefix)
- public void set_xml_parser (Parser parser)
- public override string to_string ()

### Fields:

- protected Buffer _buffer
- protected string _character_set
- protected string _compat_mode
- protected DomEvent _constructor
- protected string _content_type
- protected DomImplementation _implementation
- protected string _origin
- protected Parser _parser
- protected string _url

### Inherited Members:

All known members inherited from class GXml.XNode

- _base_uri
- _doc
- _node
- add_event_listener
- append_child
- attrs
- base_uri
- child_nodes
- children_nodes
- clone_node
- compare_document_position
- contains
- dispatch_event
- document
- first_child

- get_internal_node
- has_child_nodes
- insert_before
- is_default_namespace
- is_equal_node
- last_child
- lookup_namespace_uri
- lookup_prefix
- name
- next_sibling
- node_name
- node_type
- node_value
- normalize
- owned_node

- owner_document
- parent
- parent_element
- parent_node
- previous_sibling
- remove_child
- remove_event_listener
- replace_child
- set_namespace
- text_content
- to_gnode
- to_string
- type_node
- value

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.DomParentNode

- child_element_count
- children
- first_element_child

- get_elements_by_property_value
- last_element_child

- query_selector
- query_selector_all

All known members inherited from interface GXml.DomNonElementParentNode

- get_element_by_id

All known members inherited from interface GXml.DomDocument

- adopt_node
- character_set
- compat_mode
- content_type
- create_comment
- create_document_fragment
- create_element
- create_element_ns
- create_event
- create_node_iterator
- create_processing_instruction
- create_range
- create_stream
- create_stream_async

- create_text_node
- create_tree_walker
- doctype
- document_element
- document_uri
- get_elements_by_class_name
- get_elements_by_tag_name
- get_elements_by_tag_name_ns
- get_xml_parser
- implementation
- import_node
- origin
- read_from_file

- read_from_file_async
- read_from_stream
- read_from_stream_async
- read_from_string
- read_from_string_async
- set_xml_parser
- url
- write_file
- write_file_async
- write_stream
- write_stream_async
- write_string
- write_string_async

All known members inherited from interface GXml.XPathContext

- evaluate

All known members inherited from interface GXml.DomEventTarget

- add_event_listener

- dispatch_event

- remove_event_listener

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