XPath to address fullySelectedNode in Author View

Oxygen general issues.
SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

XPath to address fullySelectedNode in Author View

Post 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
Simon Scholz
vogella GmbH
http://www.vogella.com
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: XPath to address fullySelectedNode in Author View

Post 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
SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Re: XPath to address fullySelectedNode in Author View

Post 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
Simon Scholz
vogella GmbH
http://www.vogella.com
Post Reply