Page 1 of 1

Dita framework Actions: Activation path misalignment?

Posted: Tue Jan 15, 2019 10:21 am
by Bruno.Ballarin
Hi,

in various situations it seems there is a misalignment between:
  • the element type selected at the caret (and indicated on the top left of the Author view, see ref highlight below)
and
  • the element type detected by the Activation XPpath of a custom Action

    For instance in both examples below, with or without the xref end flag selected, a xref element is detected at the caret in the Author view, (see red higlights below), however, in the second case it seems a custom Action defined with an Activation Xpath = self::xref is NOT activated while it IS activated in the first example.

    Image

    Image

    There are other situations, including in Author view with NO tags, where there seem to be also a discrepancy between the element type detected at the caret in Author view and the element type detected by the Activation XPpath of a custom Action, for instance depending if the cursor is placed before or after an element.

    Cheers,

    Bruno

Re: Dita framework Actions: Activation path misalignment?

Posted: Tue Jan 15, 2019 10:37 am
by Radu
Hi Bruno,

When an XML element is fully selected, the cursor (caret) is outside of that element so the current element is the parent element of the selected element.
In order to accommodate for cases like yours we created a special XPath function which returns the current selected element and which can be used in the XPath activation modes when defining actions:

https://www.oxygenxml.com/doc/versions/ ... ement.html

Regards,
Radu