XPath to address fullySelectedNode in Author View

<oXygen/> general issues.
SSC
Posts: 206
Location: Hamburg, Germany

XPath to address fullySelectedNode in Author View

Tue Mar 11, 2014 2:41 pm

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: 603

Re: XPath to address fullySelectedNode in Author View

Tue Mar 11, 2014 3:43 pm

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
Location: Hamburg, Germany

Re: XPath to address fullySelectedNode in Author View

Tue Mar 11, 2014 4:10 pm

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

Return to “Other Issues”

Who is online

Users browsing this forum: Google [Bot] and 2 guests