a ! (replace node . with node())
Von: Graydon Saunders via BaseX-Talk <basex-talk@mailman.uni-konstanz.de>
Gesendet: Samstag, September 27, 2025 7:33:07 AM
An: BaseX <basex-talk@mailman.uni-konstanz.de>
Betreff: [basex-talk] replacing elements with their children using update
Hello!
So I can use
copy $c := $test
modify (for $each in $c/descendant::html:ins return replace node $each with $each/node())
return $c
to unwrap all the html ins elements in some test HTML.
If I try to do this using update (because I am under the perhaps mistaken impression that update can do the same things copy/modify/return can)
$test update {replace node descendant::html:ins with 'CABBAGE'}
works fine; the various ins elements are found and replaced. But if I want to replace that particular ins element with its children, there doesn't seem to be a way to specify the children; the context item is the value of $test, not whatever
descendant ins element is being replaced.
How could this be written using update? Can this be written using update?
thanks!
--
Þæs oferéode, ðisses swá mæg.
-- Deor ("That passed, so may this.")