Removing an element, but retaining contents, from an external event
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 4
- Joined: Wed Oct 18, 2023 11:32 pm
Removing an element, but retaining contents, from an external event
Hi there,
We have been using javascript to invoke built-in author mode operations based on events generated from a form outside of the embedded Oxygen XML editor. For example, we have been using "SurroundWithFragmentOperation" to add a custom element tag with attributes around the current selection in the editor, based on a user's input and action in an html form. This is working really well, but we also want to implement the inverse -- allow a user to invoke an operation that removes the element tag, but retain the contents of the tag.
We've tried several of the other built-in author mode operations, but none seem to do what we need here. It seems like this would be a pretty common use-case, though, so perhaps we're missing something obvious. (We've tried DeleteElementOperation, ToggleSurroundWithElementOperation, and some combinations of DeleteElementOperation with insert operations.)
What would be the recommended way to implement this?
Thanks,
Trent
We have been using javascript to invoke built-in author mode operations based on events generated from a form outside of the embedded Oxygen XML editor. For example, we have been using "SurroundWithFragmentOperation" to add a custom element tag with attributes around the current selection in the editor, based on a user's input and action in an html form. This is working really well, but we also want to implement the inverse -- allow a user to invoke an operation that removes the element tag, but retain the contents of the tag.
We've tried several of the other built-in author mode operations, but none seem to do what we need here. It seems like this would be a pretty common use-case, though, so perhaps we're missing something obvious. (We've tried DeleteElementOperation, ToggleSurroundWithElementOperation, and some combinations of DeleteElementOperation with insert operations.)
What would be the recommended way to implement this?
Thanks,
Trent
-
- Posts: 515
- Joined: Wed May 20, 2009 2:40 pm
Re: Removing an element, but retaining contents, from an external event
Hello,
You can use the ro.sync.ecss.extensions.commons.operations.UnwrapTagsOperation for this use-case.
Best Regards,
Mihaela
You can use the ro.sync.ecss.extensions.commons.operations.UnwrapTagsOperation for this use-case.
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
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