Surround with elements and copy text content

Post here questions and problems related to oXygen frameworks/document types.
Seb
Posts: 18

Surround with elements and copy text content

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: 5088

Re: Surround with elements and copy text content

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/18.1/ug-editor/topics/editor-variables.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Seb
Posts: 18

Re: Surround with elements and copy text content

Tue Feb 21, 2017 4:18 pm

Hi Radu,

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

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 0 guests