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 » Mon Feb 20, 2017 8:13 pm

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: 6403
Joined: Fri Jul 09, 2004 5:18 pm

Re: Surround with elements and copy text content

Post by Radu » Tue Feb 21, 2017 10:21 am

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 » Tue Feb 21, 2017 4:18 pm

Hi Radu,

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

Post Reply