[oXygen-user] SurroundWithFragmentOperation duplicates selected string

Oxygen XML Editor Support support at oxygenxml.com
Thu Mar 13 09:51:12 CDT 2014


Hi Andreas,

When editing the TEI document in the Author visual editing mode there is 
a drop down on the toolbar which controls the tags display mode:

> http://www.oxygenxml.com/doc/ug-oxygen/index.html#topics/author-display-markup.html

If you set that to "Partial Tags" (the default behavior) you will see 
that entity reference characters like ẽ are actually inline 
entity nodes which besides the character have two more special partial 
start and end tag characters.
Probably sometimes you select the word but the end selection does not go 
over the end tag character, for a more clear explanation please see the 
like the image I'm attaching to the email. In this case the text cannot 
be removed because the end of the selection is inside a read-only area 
(the entity content) and this leads to the text being left as it is and 
the fragment to be inserted before it.

I understand your use case and we'll modify the 
SurroundWithFragmentOperation to be more lenient in such cases, to 
consider that you actually wanted to surround the entire entity with the 
selection.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 3/13/2014 4:26 PM, Andreas Wagner wrote:
> Hi list,
>
> In my oXygen Author mode framework, I want to offer an action to replace
> an abbreviation with its expanded form. To give a concrete example of
> one of our (TEI) files. Suppose I have a word like "accusatu." I select
> it, trigger my action, get asked what it should be replaced with and get
> (in code) this:
>
> <choice><abbr>accusa.</abbr><expan>accusatus</expan></choice>
>
> The thing is, when the selected string contains a character entity, say,
> "Jt&#x1ebd;", then the surrounding works okay, but the selected phrase
> is *repeated after* the inserted fragment, so that I get
>
> <choice><abbr>Jt&#x1ebd;</abbr><expan>Item</expan></choice>Jt&#x1ebd;
>
> This sometimes happens and sometimes it does not. With
>
> <choice><abbr>int&#x1ebd;tiõis</abbr><expan>intentionis</expan></choice>
>
> it has just worked fine.
>
> Note that for directly entered chars like nõ -> non, I have never
> noticed this problem, only when I am using numeric character references.
> Then again, it's not clear to me which cases are problematic and if they
> are so always or not. (I think with the Item from the example above it
> happens always.) But I don't know what distinguishes this case from the
> second example.
>
> (Also, from time to time I get errors because "The current context is
> read-only", which also seems to relate to the NCR entities involved and
> to how (far) I draw my selection.)
>
>
> The xml fragment that the SurroundWithFragmentOperation is using is
> this:
>
> <choice xmlns="http://www.tei-c.org/ns/1.0"><abbr></abbr><expan>${ask('Wie
> lautet die Expansion?', generic)}</expan></choice>
>
>
> Has anyone experienced similar things or can help in some way?
>
> Best,
> Andreas
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: selectionSpan.png
Type: image/png
Size: 1965 bytes
Desc: not available
Url : http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20140313/a8053eb5/attachment.png 


More information about the oXygen-user mailing list