Arguments of SurroundWithFragmentOperation
- fragment
-
The XML fragment that will surround the selection. For example, consider the fragment:
<F> <A></A> <B> <C></C> </B> </F>
and the document:<doc> <X></X> <Y></Y> <Z></Z> <doc>
Considering the selected content to be surrounded is the sequence of elementsX
andY
, then the result is:<doc> <F> <A> <X></X> <Y></Y> </A> <B> <C></C> </B> </F> <Z></Z> <doc>
Since the element
A
was the first leaf in the fragment, it received the selected content. The fragment was then inserted in the place of the selection.Note:If the first leaf is not the desired location for the surrounded fragment, you can use ro.sync.ecss.extensions.commons.operations.InsertOrReplaceFragmentOperation and set the following arguments:- fragment
- The XML fragment that will surround the selection. Use the
${selection}
editor variable in the location you want to place the surrounded fragment. - schemaAware
- Set it to false to avoid moving the fragment if it is not valid at the given location.
- schemaAware
- Note:If a selection exists, the surround with fragment operation is not schema aware.