insert-after(inserted, after
?)
Insert inserted
, one or more nodes, after node after
. Parameter after
defaults to the context node.
Examples:
insert-after(copy(.)); insert-after(<meta name="{$metaName}" content="{$metaContent}"/>, $title);
Always pass detached nodes as the first argument of insert or replace | |
---|---|
The nodes passed as the first argument of commands Example: something like what follows works fine: delete($caption); insert-after($caption, $table); While something like what follows will report an execution error: insert-after($caption, $table); delete($caption); When passing detached nodes is not possible or not desirable, simply use XPath extension function insert-after(copy($caption), $table); delete($caption); |