Surround with elements and copy text content

Post here questions and problems related to oXygen frameworks/document types.
Seb
Posts: 23
Joined: Mon Feb 20, 2017 8:03 pm

Surround with elements and copy text content

Post by Seb »

Hi,

I'm wondering if this is somehow possible with Author Mode actions:

Selecting a text snippet "Hey" in Author mode, turning it into this:

Code: Select all

<a><b><d>Hey</d></b><c>Hey</c></a>
I tried to implement such a tagging mechanism with a combination of "ExecuteMultipleWebappCompatibleActionsOperation", "InsertFragmentOperation" and "ToggleSurroundWithElementOperation", but so far I've got no desired results.
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Surround with elements and copy text content

Post by Radu »

Hi,

From what I tested one way would be to use the predefined operation InsertOrReplaceFragmentOperation with the fragment to insert being:

Code: Select all

<a><b><d>${selection}</d></b><c>${selection}</c></a>
More about editor variables:

https://www.oxygenxml.com/doc/versions/ ... ables.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Seb
Posts: 23
Joined: Mon Feb 20, 2017 8:03 pm

Re: Surround with elements and copy text content

Post by Seb »

Hi Radu,

thank you! This is exactly what I was looking for.
Post Reply