Framework: ChangeAttributeOperation
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 42
- Joined: Wed Jun 20, 2018 11:30 am
Framework: ChangeAttributeOperation
Post by pieterjan_vdw »
Hi,
I try to use the ChangeAttributeOperation.
It works to add an attribute to the selected element when the given attribute is empty.
However, when there is already an attribute value in my selected element, it simply overrides the existing attribute value.
I would like to add it as a second attribute value.
This is my current action:
Before:
<p nr_jqs="first">this is a paragraph</p>
After clicking the change operation I would like to get:
<p nr_jqs="first 2_jq">this is a paragraph</p>
How can I do this? Thanks a lot in advance.
Kind regards,
Pieterjan
I try to use the ChangeAttributeOperation.
It works to add an attribute to the selected element when the given attribute is empty.
However, when there is already an attribute value in my selected element, it simply overrides the existing attribute value.
I would like to add it as a second attribute value.
This is my current action:
changeattributeoperation.png
Simple exampleBefore:
<p nr_jqs="first">this is a paragraph</p>
After clicking the change operation I would like to get:
<p nr_jqs="first 2_jq">this is a paragraph</p>
How can I do this? Thanks a lot in advance.
Kind regards,
Pieterjan
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Framework: ChangeAttributeOperation
Hi Pieterjan,
The default ChangeAttributeOperation just sets the new value instead of the old one, there is no setting to instruct it to preserve the old value.
Maybe you can use a JSOperation instead and write a small script which uses our APIs to check what the old value of the element is, take the old value, combine it with the new value and set it back:
https://www.oxygenxml.com/doc/versions/ ... soperation
There are some sample JSOperations here:
https://github.com/oxygenxml/javascript ... operations
Regards,
Radu
The default ChangeAttributeOperation just sets the new value instead of the old one, there is no setting to instruct it to preserve the old value.
Maybe you can use a JSOperation instead and write a small script which uses our APIs to check what the old value of the element is, take the old value, combine it with the new value and set it back:
https://www.oxygenxml.com/doc/versions/ ... soperation
There are some sample JSOperations here:
https://github.com/oxygenxml/javascript ... operations
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 42
- Joined: Wed Jun 20, 2018 11:30 am
Re: Framework: ChangeAttributeOperation
Post by pieterjan_vdw »
Hi Radu,
In this case this is a framework within a system using the webauthor. If I understand the documentation correctly, this is not possible with a JSOperation.
Do you have another suggestion?
Kind regards,
Pieterjan
In this case this is a framework within a system using the webauthor. If I understand the documentation correctly, this is not possible with a JSOperation.
Do you have another suggestion?
Kind regards,
Pieterjan
-
- Posts: 515
- Joined: Wed May 20, 2009 2:40 pm
Re: Framework: ChangeAttributeOperation
Hello,
The JSOperation cannot be invoked in Oxygen XML Web Author using the JavaScript API, but you can use it as an operation for an Author Action (and it will work als in Web Author).
So, you can use the JSOperation in the document type settings Action dialog.
We will update the documentation to be more clear.
Best Regards,
Mihaela
The JSOperation cannot be invoked in Oxygen XML Web Author using the JavaScript API, but you can use it as an operation for an Author Action (and it will work als in Web Author).
So, you can use the JSOperation in the document type settings Action dialog.
We will update the documentation to be more clear.
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
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