Page 1 of 1

XPath to address fullySelectedNode in Author View

Posted: Tue Mar 11, 2014 2:41 pm
by SSC
Hello,

We are using the Eclipse version of Oxygen 15.2.

I am currently trying to add a custom ro.sync.ecss.extensions.api.AuthorOperation and wonder how I can use the XPath Expression to evaluate the fullySelectedNode.

I only want to show the action, when the AuthorNode contains a certain PI:

Code: Select all


./processing-instruction('tag')
This works if the cursor is in the text, but I´d also like to show the action, if the complete AuthorNode is selected. I mean when a user selects the tag in case the full tags are shown => ro.sync.ecss.extensions.api.node.AuthorNode.getFullySelectedNode().
I that case the XPath obove does not work out and the action is unfortunately not shown.

Do you eventually have a custom XPath expression term/syntax to also check the fully selected node?

Best regards,

Simon

Re: XPath to address fullySelectedNode in Author View

Posted: Tue Mar 11, 2014 3:43 pm
by alex_jitianu
Hello Simon,

There's an XPath extension function that you can use: oxy:current-selected-element(). It returns the fully selected node (if any). This function can be used in the activation XPath of an action as well as in any operation argument which is an XPath expression.

For your situation you'll probably have an activation XPath like this:

Code: Select all

oxy:current-selected-element()/processing-instruction('tag')

Best regards,
Alex

Re: XPath to address fullySelectedNode in Author View

Posted: Tue Mar 11, 2014 4:10 pm
by SSC
Thank you Alex,

this is exactly what I´ve been looking for. :)

In several cases, when you offer your own custom variables/functions, you also have a dropdown menu, which contains those variables and functions.
Maybe you could add such a thing also besides the XPath Text Control in the AuthorOperation Dialog.

Maybe also a List of all your custom varibales, which can be used in CSS/XPath expressions/..., would be helpful.

Best regards,

Simon