Top | ![]() |
![]() |
![]() |
![]() |
GXmlxNodeGXmlxNode — Represents an XML xNode, the base class for most XML structures in the GXmlxDocument's tree. |
GXmlxDocuments are GXmlxNodes, and are composed of a tree of GXmlxNodes.
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-1950641247
GXmlNamespaceAttr * gxml_xnode_add_namespace_attr (GXmlxNode *self
,const gchar *uri
,const gchar *namespace_prefix
);
Add a new namespace to this GXmlxNode
gboolean gxml_xnode_set_namespace (GXmlxNode *self
,const gchar *uri
,const gchar *namespace_prefix
);
Set namespace to this GXmlxNode
Returns: true if namespace exists.
GXmlxNode * gxml_xnode_insert_before (GXmlxNode *self
,GXmlxNode *new_child
,GXmlxNode *ref_child
);
Insert new_child
as a child to this node, and place it in the list before ref_child
.
If ref_child
is NULL
, new_child
is appended to the list of children instead.
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-insertBefore
new_child
, the node that has been inserted. Do not free it, its memory will be released when the owning GXmlxDocument is freed.
GXmlxNode * gxml_xnode_replace_child (GXmlxNode *self
,GXmlxNode *new_child
,GXmlxNode *old_child
);
Replaces old_child
with new_child
in this node's list of children.
Version: DOM Level 1 Core URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-replaceChild
The removed node old_child
. Do not free it, its memory will be released when the owning GXmlxDocument is freed.
GXmlxNode * gxml_xnode_remove_child (GXmlxNode *self
,GXmlxNode *old_child
);
Removes old_child
from this node's list of children, "child-nodes".
Version: DOM Level 1 Core URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-removeChild
The removed node old_child
. Do not free it, its memory will be released when the owning GXmlxDocument is freed
GXmlxNode * gxml_xnode_append_child (GXmlxNode *self
,GXmlxNode *new_child
);
Appends new_child
to the end of this node's list of children, "child-nodes".
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-appendChild
The newly added child, new_child
. Do not free it, its memory will be released when the owning GXmlxDocument is freed.
gboolean
gxml_xnode_has_child_nodes (GXmlxNode *self
);
Indicates whether this node has children.
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-hasChildNodes
GXmlxNode * gxml_xnode_clone_node (GXmlxNode *self
,gboolean deep
);
Creates a parentless copy of this node.
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-cloneNode
self |
the GXmlxNode instance |
|
deep |
. If true, descendants are cloned as well. If false, they are not . |
[in] |
A parentless clone of this node. Do not free it, its memory will be released when the owning GXmlxDocument is freed.
gchar * gxml_xnode_stringify (GXmlxNode *self
,gboolean format
,gint level
);
Provides a string representation of this node.
Note that if the DOM tree contains a Text node, a CDATA section, or an EntityRef, it will not be formatted, since the current implementation with libxml2 will not handle that case. (See libxml2's xmlNodeDumpOutput internals to understand more.)
self |
the GXmlxNode instance |
|
format |
.
. |
[in] |
level |
. Indentation level . |
[in] |
GeeList *
gxml_xnode_get_namespace_definitions (GXmlxNode *self
);
Get and return the current value of the "namespace-definitions" property.
The list of attributes that store namespace definitions. This is not part of a DOM spec.
The caller must free this using
.g_object_unref()
const gchar *
gxml_xnode_get_namespace_uri (GXmlxNode *self
);
Get and return the current value of the "namespace-uri" property.
Stores the URI describing the node's namespace. This only applies to Elements and Attrs from DOM Level 2 Core that were created with namespace support.
Do not free this. It's memory will be released when the owning GXmlxDocument is freed.
Version: DOM Level 2 Core
URL: http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-NodeNSname
const gchar *
gxml_xnode_get_namespace_prefix (GXmlxNode *self
);
Get and return the current value of the "namespace-prefix" property.
Stores the namespace prefix for the node. This only applies to Elements and Attrs from DOM Level 2 Core that were created with namespace support.
Do not free this. It's memory will be released when the owning GXmlxDocument is freed.
Version: DOM Level 2 Core
URL: http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-NodeNSPrefix
const gchar *
gxml_xnode_get_local_name (GXmlxNode *self
);
Get and return the current value of the "local-name" property.
Stores the local name within the namespace. This only applies to Elements and Attrs from DOM Level 2 Core that were created with namespace support.
Do not free this. It's memory will be released when the owning GXmlxDocument is freed.
Version: DOM Level 2 Core
URL: http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-NodeNSLocalN
const gchar *
gxml_xnode_get_node_name (GXmlxNode *self
);
Get and return the current value of the "node-name" property.
Stores the name of the node. Sometimes this is similar to the node type, but sometimes, it is arbitrary data, like for GXmlAttribute where the node_name is the name of the Attr's name=value pair.
Do not free this. It's memory will be released when the owning GXmlxDocument is freed.
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-F68D095
const gchar *
gxml_xnode_get_node_value (GXmlxNode *self
);
Get and return the current value of the "node-value" property.
Stores the value of the xNode. The nature of node_value varies based on the type of node. This can be NULL
.
Do not free this. It's memory will be released when the owning GXmlxDocument is freed.
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-F68D080
GXmlNodeType
gxml_xnode_get_node_type (GXmlxNode *self
);
Get and return the current value of the "node-type" property.
Stores the type of node. Most XML structures are nodes of different types, like GXmlxDocument as a GXML_NODE_TYPE_DOCUMENT, GXmlAttribute as a GXML_NODE_TYPE_ATTRIBUTE, Element as a GXML_NODE_TYPE_ELEMENT, etc.
Version: DOM Level 1 Core URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-111237558
GXmlxNode *
gxml_xnode_get_parent_node (GXmlxNode *self
);
Get and return the current value of the "parent-node" property.
A link to the parent_node of this node. For example, with elements, the immediate, outer element is the parent.
Do not free this. It's memory will be released when the owning GXmlxDocument is freed.
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-1060184317
GXmlxNodeList *
gxml_xnode_get_child_nodes (GXmlxNode *self
);
Get and return the current value of the "child-nodes" property.
List of child nodes to this node. These sometimes represent the value of a node as a tree of GXmlxNode, whereas node_value represents it as a string. This can be NULL
for node types that have no children.
The GXmlNodeList is live, in that changes to this node's children will be reflected in an already-active GXmlNodeList.
The caller must call
on the list when it is done with it. The lists are constructed dynamically.g_object_unref()
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-1451460987
GXmlxNode *
gxml_xnode_get_first_child (GXmlxNode *self
);
Get and return the current value of the "first-child" property.
Links to the first child. If there are no children, it returns NULL
.
Do not free this. It's memory will be released when the owning GXmlxDocument is freed.
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-169727388
GXmlxNode *
gxml_xnode_get_last_child (GXmlxNode *self
);
Get and return the current value of the "last-child" property.
Links to the last child. If there are no children, it returns NULL
.
Do not free this. It's memory will be released when the owning GXmlxDocument is freed.
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-61AD09FB
GXmlxNode *
gxml_xnode_get_previous_sibling (GXmlxNode *self
);
Get and return the current value of the "previous-sibling" property.
Links to this node's preceding sibling. If there are no previous siblings, it returns NULL
. Note that the children of a node are ordered.
Do not free this. It's memory will be released when the owning GXmlxDocument is freed.
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-640FB3C8
GXmlxNode *
gxml_xnode_get_next_sibling (GXmlxNode *self
);
Get and return the current value of the "next-sibling" property.
Links to this node's next sibling. If there is no next sibling, it returns NULL
. Note that the children of a node are ordered.
Do not free this. It's memory will be released when the owning GXmlxDocument is freed.
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-6AC54C2F
GXmlNamedAttrMap *
gxml_xnode_get_attributes (GXmlxNode *self
);
Get and return the current value of the "attributes" property.
A GXmlNamedNodeMap containing the GXmlAttribute attributes for this node. attributes
actually only apply to GXmlElement nodes. For all other GXmlxNode subclasses, attributes
is NULL
.
Do not free this. It's memory will be released when the owning GXmlxDocument is freed.
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-84CF09
GXmlxDocument *
gxml_xnode_get_owner_document (GXmlxNode *self
);
Get and return the current value of the "owner-document" property.
A link to the GXmlxDocument to which this node belongs.
Do not free this unless you intend to free all memory owned by the GXmlxDocument, including this GXmlxNode.
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#node-ownerDoc
GeeList *
gxml_xnode_get_namespaces (GXmlxNode *self
);
Get and return the current value of the "namespaces" property.
GeeBidirList *
gxml_xnode_get_children_nodes (GXmlxNode *self
);
Get and return the current value of the "children-nodes" property.
GeeMap *
gxml_xnode_get_attrs (GXmlxNode *self
);
Get and return the current value of the "attrs" property.
gchar *
gxml_xnode_get_name (GXmlxNode *self
);
Get and return the current value of the "name" property.
gchar *
gxml_xnode_get_value (GXmlxNode *self
);
Get and return the current value of the "value" property.
void gxml_xnode_set_value (GXmlxNode *self
,const gchar *value
);
Set the value of the "value" property to value
.
struct GXmlxNode { GObject parent_instance; GXmlxNodePrivate * priv; GXmlxNodeList* _child_nodes; GXmlNamedAttrMap* _attributes; GXmlNamespaceAttrNodeList* _namespace_definitions; };
Represents an XML xNode, the base class for most XML structures in the GXmlxDocument's tree.
GXmlxDocuments are GXmlxNodes, and are composed of a tree of GXmlxNodes.
Version: DOM Level 1 Core
URL: http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-1950641247
struct GXmlxNodeClass { GObjectClass parent_class; GXmlNamespaceAttr* (*add_namespace_attr) (GXmlxNode* self, const gchar* uri, const gchar* namespace_prefix); gboolean (*set_namespace) (GXmlxNode* self, const gchar* uri, const gchar* namespace_prefix); GXmlxNode* (*insert_before) (GXmlxNode* self, GXmlxNode* new_child, GXmlxNode* ref_child); GXmlxNode* (*replace_child) (GXmlxNode* self, GXmlxNode* new_child, GXmlxNode* old_child); GXmlxNode* (*remove_child) (GXmlxNode* self, GXmlxNode* old_child); GXmlxNode* (*append_child) (GXmlxNode* self, GXmlxNode* new_child); gboolean (*has_child_nodes) (GXmlxNode* self); GXmlxNode* (*clone_node) (GXmlxNode* self, gboolean deep); gchar* (*stringify) (GXmlxNode* self, gboolean format, gint level); gchar* (*to_string) (GXmlxNode* self); GeeList* (*get_namespace_definitions) (GXmlxNode* self); void (*set_namespace_definitions) (GXmlxNode* self, GeeList* value); const gchar* (*get_namespace_uri) (GXmlxNode* self); void (*set_namespace_uri) (GXmlxNode* self, const gchar* value); const gchar* (*get_namespace_prefix) (GXmlxNode* self); void (*set_namespace_prefix) (GXmlxNode* self, const gchar* value); const gchar* (*get_local_name) (GXmlxNode* self); void (*set_local_name) (GXmlxNode* self, const gchar* value); const gchar* (*get_node_name) (GXmlxNode* self); void (*set_node_name) (GXmlxNode* self, const gchar* value); const gchar* (*get_node_value) (GXmlxNode* self); void (*set_node_value) (GXmlxNode* self, const gchar* value); GXmlNodeType (*get_node_type) (GXmlxNode* self); void (*set_node_type) (GXmlxNode* self, GXmlNodeType value); GXmlxNode* (*get_parent_node) (GXmlxNode* self); void (*set_parent_node) (GXmlxNode* self, GXmlxNode* value); GXmlxNodeList* (*get_child_nodes) (GXmlxNode* self); void (*set_child_nodes) (GXmlxNode* self, GXmlxNodeList* value); GXmlxNode* (*get_first_child) (GXmlxNode* self); void (*set_first_child) (GXmlxNode* self, GXmlxNode* value); GXmlxNode* (*get_last_child) (GXmlxNode* self); void (*set_last_child) (GXmlxNode* self, GXmlxNode* value); GXmlxNode* (*get_previous_sibling) (GXmlxNode* self); void (*set_previous_sibling) (GXmlxNode* self, GXmlxNode* value); GXmlxNode* (*get_next_sibling) (GXmlxNode* self); void (*set_next_sibling) (GXmlxNode* self, GXmlxNode* value); GXmlNamedAttrMap* (*get_attributes) (GXmlxNode* self); void (*set_attributes) (GXmlxNode* self, GXmlNamedAttrMap* value); GeeList* (*get_namespaces) (GXmlxNode* self); GeeBidirList* (*get_children_nodes) (GXmlxNode* self); GeeMap* (*get_attrs) (GXmlxNode* self); gchar* (*get_name) (GXmlxNode* self); gchar* (*get_value) (GXmlxNode* self); void (*set_value) (GXmlxNode* self, const gchar* value); GXmlNode* (*get_parent) (GXmlxNode* self); };
The class structure for GXML_TYPE_XNODE
. All the fields in this structure are private and should never be accessed directly.
virtual method called by |
||
virtual method called by |
||
virtual method called by |
||
virtual method called by |
||
virtual method called by |
||
virtual method called by |
||
virtual method called by |
||
virtual method called by |
||
virtual method called by |
||
virtual method called by |
||
getter method for the abstract property "namespace-definitions" |
||
getter method for the abstract property "namespace-uri" |
||
getter method for the abstract property "namespace-prefix" |
||
getter method for the abstract property "local-name" |
||
getter method for the abstract property "node-name" |
||
getter method for the abstract property "node-value" |
||
getter method for the abstract property "node-type" |
||
getter method for the abstract property "parent-node" |
||
getter method for the abstract property "child-nodes" |
||
getter method for the abstract property "first-child" |
||
getter method for the abstract property "last-child" |
||
getter method for the abstract property "previous-sibling" |
||
getter method for the abstract property "next-sibling" |
||
getter method for the abstract property "attributes" |
||
getter method for the abstract property "namespaces" |
||
getter method for the abstract property "children-nodes" |
||
getter method for the abstract property "attrs" |
||
getter method for the abstract property "name" |
||
getter method for the abstract property "value" |
||
setter method for the abstract property "value" |
||
getter method for the abstract property "parent" |