Surround with multiple tags

Questions about XML that are not covered by the other forums should go here.
questpro
Posts: 1
Joined: Mon Apr 21, 2014 1:28 am

Surround with multiple tags

Post by questpro »

In "Author" mode there is function "Surround with Tags..."
Question: is there possibility to surround with multiple tags at once?

For example i have:
"word"
and i want to get
"<sup><span>word</span></sup>"

And another question:
When i use function "Surround with Tags..." it provide me small list with variant such as "element", "img", "table", "cdata", "comment". Does this dialog configurable, can i add tags to surround fast from the dialog?
alex_jitianu
Posts: 1016
Joined: Wed Nov 16, 2005 11:11 am

Re: Surround with multiple tags

Post by alex_jitianu »

Hello,

I think there are two possible solutions to both of your questions:
1. You can create author actions that use the SurroundWithFragmentOperation to specify the elements that will wrap the selection. These actions can be added in the content completion menu or in toolbars and menus. To refer to your example, this author operation will specify as fragment: <sup><span></span></sup> and, as a result, the selection will be wrapped in a sup and a span.
2. You can use the code templates support in Oxygen to define your own code templates. These code templates are basically XML fragments, for example one that handles your sample situation is: <sup><span>${selection}</span></sup>.

Code templates are automatically added in the Content completion menu and will also be presented in the list of elements from action Surround with Tags.... If you go with author actions instead, if you add them in the content completion menu, they will also be presented inside Surround with Tags....

Best regards,
Alex
Post Reply