Currently there is no way to effectively
set the text value of a XML::Mini::Element.
->text as you know only APPENDS.
There is no way to get at the nodes
through the API
(i consider this a major design flaw)
A remedy might be to provide the following methods
insertNode
prependNode
removeNode
removeAllNodes
getAllNodes
The following already exist.
createNode
appendNode
These should be trivial to implement.
Here's the perl implementation
(My cpanid is PODMASTER)
sub insertNode {
splice @{ $_[0]->{_children} }, $_[1], 0, $_[2];
return $_[2];
}
sub prependNode {
unshift @{ $_[0]->{_children} }, $_[1];
return $_[1];
}
sub removeNode {
return splice @{ $_[0]->{_children} }, $_[1], 1;
}
sub removeAllNodes {
my $kids = $_[0]->{_children};
$_[0]->{_children} = [];
return $kids;
}
sub getAllNodes {
return $_[0]->{_children};
}