Form control - how to replace text using Author Mode Operations?
Oxygen general issues.
-
- Posts: 7
- Joined: Mon May 02, 2022 11:48 am
Form control - how to replace text using Author Mode Operations?
Hi,
I want to use the combobox that changes simultaneously two different values (I am using Oxygen 20.1):
1) A @key value of the <author> - this works perfectly with label and value
2) Name of the author within the element <author> - and I cannot achieve that.
What I tried was to add onChange parameter to the oxy_combobox, and then pair oxy_action with onChange with operation, 'InsertOrReplaceFragmentOperation'. However, this does not work:
(My third future step is to replace "Placeholder name" with oxy_xpath that would find the name of the author in another .xml file using @key.)
I also tried other insertLocation xpaths but without success.
Any idea?
Thank you very much in advance!
Jan
I want to use the combobox that changes simultaneously two different values (I am using Oxygen 20.1):
1) A @key value of the <author> - this works perfectly with label and value
2) Name of the author within the element <author> - and I cannot achieve that.
What I tried was to add onChange parameter to the oxy_combobox, and then pair oxy_action with onChange with operation, 'InsertOrReplaceFragmentOperation'. However, this does not work:
Code: Select all
onChange, oxy_action(
name, 'Replace ',
operation, 'InsertOrReplaceFragmentOperation',
arg-fragment, 'Placeholder name',
arg-insertLocation, './text()',
arg-insertPosition, 'Replace' )
);
I also tried other insertLocation xpaths but without success.
Any idea?

Thank you very much in advance!
Jan
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Form control - how to replace text using Author Mode Operations?
Post by alex_jitianu »
Hello,
I tried this myself and what I observed was that a new "Placeholder name" part was inserted instead of replacing the entire content. Is this what happens in your case as well? It does this because the operation only replaces the selection and in this case you have no selection. In the later version of Oxygen we added another operation, ReplaceElementContentOperation, which behaves like you desire. For 20.1 you can use JSOperation or XQueryUpdateOperation:
Best regards,
Alex
I tried this myself and what I observed was that a new "Placeholder name" part was inserted instead of replacing the entire content. Is this what happens in your case as well? It does this because the operation only replaces the selection and in this case you have no selection. In the later version of Oxygen we added another operation, ReplaceElementContentOperation, which behaves like you desire. For 20.1 you can use JSOperation or XQueryUpdateOperation:
Code: Select all
p {
content: oxy_combobox(
edit, '@attribute',
editable, false,
values, 'value1, value2, value3',
labels, 'Value no1, Value no2, Value no3',
onChange, oxy_action(
name, 'Replace ',
operation, 'XQueryUpdateOperation',
arg-script, 'replace value of node . with "Placeholder name"'
)
)
}
Alex
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