Action for changing multiple elements at once
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Action for changing multiple elements at once
Post by Frank Ralf »
Hi,
I'm working on an action to remove all "status" attributes from a topic using the ChangeAttributeOperation (see also "How to toggle attribute values?".) However, I haven't figured out yet how to make the action work for multiple elements at the same time.
Is this a matter of the correct XPath expression or do I have to use some kind of loop construction? (If yes, how?)
TIA
Frank
I'm working on an action to remove all "status" attributes from a topic using the ChangeAttributeOperation (see also "How to toggle attribute values?".) However, I haven't figured out yet how to make the action work for multiple elements at the same time.
Is this a matter of the correct XPath expression or do I have to use some kind of loop construction? (If yes, how?)
TIA
Frank
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Re: Action for changing multiple elements at once
Post by Frank Ralf »
I've already found "Editing multiple AuthorNodes at once" which suggests that this might have to be solved on the underlying Java level.
Frank
Frank
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Action for changing multiple elements at once
Post by alex_jitianu »
Hello Frank,
ChangeAttributeOperation has an argument named elementLocation. Its value is an XPath expression that identifies the element to process. Unfortunately for you use case, ChangeAttributeOperation processes only one element (so even if you use an XPath expression that identifies multiple elements, only the first one is removed).
Using our JAVA based API you can create a custom change attribute operation. ChangeAttributeOperation can consist in a very good starting point. It already executes the XPath and identifies the nodes. All you have to do is iterate over all of them instead of just processing the first one. We have a tutorial on Author Framework Development. There is also a topic on How to Add a Custom Operation (please take notice that this topic has links to the v16.0 SDK which uses Maven). Once you create the start-up project, inside folder samples/Oxygen Default Frameworks you will find the source code for ChangeAttributeOperation.
Best regards,
Alex
ChangeAttributeOperation has an argument named elementLocation. Its value is an XPath expression that identifies the element to process. Unfortunately for you use case, ChangeAttributeOperation processes only one element (so even if you use an XPath expression that identifies multiple elements, only the first one is removed).
Using our JAVA based API you can create a custom change attribute operation. ChangeAttributeOperation can consist in a very good starting point. It already executes the XPath and identifies the nodes. All you have to do is iterate over all of them instead of just processing the first one. We have a tutorial on Author Framework Development. There is also a topic on How to Add a Custom Operation (please take notice that this topic has links to the v16.0 SDK which uses Maven). Once you create the start-up project, inside folder samples/Oxygen Default Frameworks you will find the source code for ChangeAttributeOperation.
Best regards,
Alex
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Re: Action for changing multiple elements at once
Post by Frank Ralf »
Hi Alex,
Many thanks for the explanation and for pointing me in the right direction!
Kind regards,
Frank
Many thanks for the explanation and for pointing me in the right direction!
Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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