public final class ReplaceValue extends NodeUpdate
ReplaceValue primitive. Replaces the value of a node.
If the target T is an element node this primitive represents a replaceElementContent expression (see XQUF). The children of T are deleted and a single (optional) text node is inserted as the only child of T. The primitive for replaceElementContent is substituted by [delete children(T), insertInto(T)].
After the end of the snapshot, T has either no child node at all (if the given text node has been empty), or the given (non-empty) text node as a single child. Attributes of T are not affected by a replaceElementContent expression.
If T is a text node and the new text value is empty, T is deleted.
Modifier and Type | Field and Description |
---|---|
boolean |
rec
States if this primitive represents a replaceElementContent expression.
|
pre
data
Constructor and Description |
---|
ReplaceValue(int pre,
Data data,
InputInfo ii,
byte[] value)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAtomics(AtomicUpdateCache auc)
Adds the atomic update operations for this update primitive to the given list.
|
void |
merge(Update update)
Merges two update primitives, as they have the same target node.
|
void |
prepare(MemData tmp)
Prepares this update primitive before execution.
|
int |
size()
Returns the number of update operations.
|
NodeUpdate[] |
substitute(MemData tmp)
Substitutes the update primitive if necessary.
|
String |
toString() |
void |
update(NamePool pool)
Updates the name pool, which is used to find duplicate attributes
and namespace conflicts.
|
node
data
public final boolean rec
public void prepare(MemData tmp)
NodeUpdate
prepare
in class NodeUpdate
tmp
- temporary databasepublic void merge(Update update) throws QueryException
NodeUpdate
merge
in class NodeUpdate
update
- primitive to merge withQueryException
- exceptionpublic int size()
Update
public void addAtomics(AtomicUpdateCache auc)
NodeUpdate
addAtomics
in class NodeUpdate
auc
- list of atomic updatespublic NodeUpdate[] substitute(MemData tmp)
NodeUpdate
substitute
in class NodeUpdate
tmp
- temporary mem datapublic void update(NamePool pool)
NodeUpdate
update
in class NodeUpdate
pool
- name poolCopyright © 2005–2015 BaseX Team. All rights reserved.