Action ToggleSurroundWithElementOperation inconsistent
Post here questions and problems related to oXygen frameworks/document types.
Action ToggleSurroundWithElementOperation inconsistent
Sorry, first post. I'll read up on conventions to make this and subsequent questions better. Thanks for your attention meanwhile.
There seems to be inconsistent behavior with ToggleSurroundWithElementOperation in the following scenario:
<element>text before {startSel}text inside{endSel} text after</element>
I've found that DocBook 4 works to surround the selected text, and remove it if the same text is selected, (with <emphasis role="bold"/>, so I'm using it as an example.
This is the behavior I'm trying to implement using my own <mh:Bold> element in a custom schema. I'm starting my framework from scratch and have it validating with my schema and catalog to include the mh:Bold and others.
As far as I can tell, my action is configured exactly as the DocBook 4 one, but with "<mh:Bold/>" as the element value. However, it behaves strangely:
<diag:Overview>Every ch{cursor}ild ...</diag:Overview>
<diag:Overview>Every <mh:Bold>ch{cursor}ild</mh:Bold> ...</diag:Overview>
That's okay, but using that selection and invoking the action again, surrounds with another one:
<diag:Overview>Every <mh:Bold><mh:Bold>ch{cursor}ild</mh:Bold></mh:Bold>
That's unexpected. I thought the action would remove the surrounding <mh:Bold/>. This also does nothing when I select the entire text in <mh:Bold/> or the <mh:Bold/> element itself. This may be due to the same behavior as the following:
<diag:Overview>Every{startSel}child{endSel} ...</diag:Overview>
... nothing. The menu bar for my framework blinks, but that's it.
FYI, DITA appears broken in a similar way that mine is, with a simple <b/>. If the cursor is inside text it will surround the current "word" only if there is no text selected; just the cursor in a word. If text is selected, it will do nothing, unless the entire element (<p/>) is selected. This seems to be a problem also.
There seems to be inconsistent behavior with ToggleSurroundWithElementOperation in the following scenario:
<element>text before {startSel}text inside{endSel} text after</element>
I've found that DocBook 4 works to surround the selected text, and remove it if the same text is selected, (with <emphasis role="bold"/>, so I'm using it as an example.
This is the behavior I'm trying to implement using my own <mh:Bold> element in a custom schema. I'm starting my framework from scratch and have it validating with my schema and catalog to include the mh:Bold and others.
As far as I can tell, my action is configured exactly as the DocBook 4 one, but with "<mh:Bold/>" as the element value. However, it behaves strangely:
<diag:Overview>Every ch{cursor}ild ...</diag:Overview>
<diag:Overview>Every <mh:Bold>ch{cursor}ild</mh:Bold> ...</diag:Overview>
That's okay, but using that selection and invoking the action again, surrounds with another one:
<diag:Overview>Every <mh:Bold><mh:Bold>ch{cursor}ild</mh:Bold></mh:Bold>
That's unexpected. I thought the action would remove the surrounding <mh:Bold/>. This also does nothing when I select the entire text in <mh:Bold/> or the <mh:Bold/> element itself. This may be due to the same behavior as the following:
<diag:Overview>Every{startSel}child{endSel} ...</diag:Overview>
... nothing. The menu bar for my framework blinks, but that's it.
FYI, DITA appears broken in a similar way that mine is, with a simple <b/>. If the cursor is inside text it will surround the current "word" only if there is no text selected; just the cursor in a word. If text is selected, it will do nothing, unless the entire element (<p/>) is selected. This seems to be a problem also.
-
- Posts: 1009
- Joined: Wed Nov 16, 2005 11:11 am
Re: Action ToggleSurroundWithElementOperation inconsistent
Post by alex_jitianu »
Hi,
Please make sure that your action uses the ro.sync.ecss.extensions.commons.operations.ToggleSurroundWithElementOperation operation because only this operation knows how to wrap/unwrap. I suspect that your action is currently using ro.sync.ecss.extensions.commons.operations.SurroundWithFragmentOperation which doesn't know how to unwrap. Let me know if this was indeed your situation. If not, can you send me the framework on support@oxygenxml.com to have a look at it? What Oxygen version are you using?
Best regards,
Alex
Please make sure that your action uses the ro.sync.ecss.extensions.commons.operations.ToggleSurroundWithElementOperation operation because only this operation knows how to wrap/unwrap. I suspect that your action is currently using ro.sync.ecss.extensions.commons.operations.SurroundWithFragmentOperation which doesn't know how to unwrap. Let me know if this was indeed your situation. If not, can you send me the framework on support@oxygenxml.com to have a look at it? What Oxygen version are you using?
Best regards,
Alex
Re: Action ToggleSurroundWithElementOperation inconsistent
Yes, these are all the same ToggleSurroundWithElementOperation. I have since had success with a combination of SurroundWithFragmentOperation and UnwrapTagsOperation, but I'll send the framework with Toggle, because I expect that to work as described. I started with 17 and updated to 18.1 without a change in this behavior.
Meanwhile, do you see the same behavior I see with the DITA framework and bold (<b/>)? If that works for others, then I suspect my environment may be problematic.
Meanwhile, do you see the same behavior I see with the DITA framework and bold (<b/>)? If that works for others, then I suspect my environment may be problematic.
-
- Posts: 1009
- Joined: Wed Nov 16, 2005 11:11 am
Re: Action ToggleSurroundWithElementOperation inconsistent
Post by alex_jitianu »
Hi,
I'll have a look at the framework. I have to say that I don't reproduce the described behavior using the built-in DITA framework.
Best regards,
Alex
I'll have a look at the framework. I have to say that I don't reproduce the described behavior using the built-in DITA framework.
Best regards,
Alex
Re: Action ToggleSurroundWithElementOperation inconsistent
Radu answered with the solution (excerpt):
~Ryan
Thanks Radu!The proper value should actually be:
<mh:Bold xmlns:mh="http://medhomeportal.org/schemas/MedhomeCommon"/>
Oxygen will use the namespace information in the XML fragment and the toggle should start working fine for your case.
~Ryan
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service