Page 1 of 1

Delete selected multiple elements

Posted: Mon Jul 04, 2022 10:35 am
by Edomonndo
Hi,

We changed to display the definition list as table style.
And our writer requested to add the action to delete dlentry elements because the table style does not show dlentry elements corresponding to row.

I tried DeleteElementsOperation like this:
Xpath activation: ancestor-or-self::*[contains(@class," topic/dlentry ")]
elementLocations: ancestor-or-self::*[contains(@class," topic/dlentry ")]

However, this works if single dlentry is selected. If you select multiple dlentry or inside elements, the last dlentry is deleted.
How can I implement to delete multiple dlentry at once?

Re: Delete selected multiple elements

Posted: Mon Jul 04, 2022 10:57 am
by Radu
Hi Edmonndo,
No matter how many nodes are selected in the Author mode, there is only one context node for the xpath expression execution.
Maybe you can try something like this for the "ElementLocations" parameter value:

Code: Select all

parent::*/*[contains(@class," topic/dlentry ")]
so that you first go one level up to the parent of the current dlentry and then select all the child dlentry elements of the parent.

Regards,
Radu

Re: Delete selected multiple elements

Posted: Mon Jul 04, 2022 1:09 pm
by Edomonndo
Hi Radu,

Thank you for the advice!
I'll try your code.