Dita framework Actions: Activation path misalignment?

Post here questions and problems related to oXygen frameworks/document types.
Bruno.Ballarin
Posts: 24
Joined: Thu Aug 07, 2014 3:40 pm

Dita framework Actions: Activation path misalignment?

Post by Bruno.Ballarin » Tue Jan 15, 2019 10:21 am

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

Radu
Posts: 6191
Joined: Fri Jul 09, 2004 5:18 pm

Re: Dita framework Actions: Activation path misalignment?

Post by Radu » Tue Jan 15, 2019 10:37 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply