Module model

The module provides access and modification of a DOM model. The DOM model is generalized so that it can be used to store both XML and JSON. This is done in that a text done can hold not only strings, but also other scalar data such as numbers. Further, the attribute axis of DOM element can also hold other DOM elements than only scalar data.

The following model predicates are provided:

node_is_elem(D):
The predicate succeeds if the DOM node D is a DOM element.
node_is_text(D):
The predicate succeeds if the DOM node D is a DOM text.
node_get_parent(D, C):
The predicate succeeds in C with the parent of the DOM node D.
node_get_key(D, K):
The predicate succeeds in K with the key name of the DOM node D.
node_set_key(D, K):
The predicate succeeds in setting the key name of the DOM node D to K.
node_copy(D, C):
The predicate succeeds in C with a copy of the DOM node D.
text_new(D):
The predicate succeeds in D with a new DOM text.
text_get_data(D, T):
The predicate succeeds in T with the data of the DOM text D.
text_set_data(D, T):
The predicate succeeds in setting the data of the DOM text D to T.
elem_new(D):
The predicate succeeds in D with a new DOM element.
elem_get_name(D, N):
The predicate succeeds in N with the name of the DOM element D.
elem_set_name(D, N):
The predicate succeeds in setting the name of the DOM element D to N.
elem_get_attr(D, A, V):
The predicate succeeds in V with the attribute A of the DOM element D.
elem_set_attr(D, A, V):
The predicate succeeds in setting the attribute A of the DOM element D to V.
elem_reset_attr(D, A):
The predicate succeeds in removing the attribute A from the DOM element D.
elem_attr(D, A):
The predicate succeeds in A for all the attribute names of the DOM element D.
elem_add_node(D, C):
The predicate succeeds in adding the DOM node C to the DOM element D.
elem_remove_node(D, C):
The predicate succeeds in removing the DOM node C from the DOM element D.
elem_node(D, C):
The predicate succeeds in C for all the DOM nodes of the DOM element D.

Comments