Page 1 of 1

XPath contexts in MultipleActionsOperation

Posted: Tue Mar 15, 2016 5:14 pm
by stdu
Hi,

we encoutered a problem with the ExecuteMultipleActionsOperation for Author. Our use-case:

One Action with ExecuteMultipleActionsOperation which execute the following two actions:

Action 1 sourrounds the current selection with an element, an attribute value is set by the user (via ${ask} dialog)
Action 2 should add an second attribut (via ChangeAttributeOperation) depending of the attribute set by the first action

This is why we want to use mulitple operations in the action 2 by differentiating them with the help of the XPath contexts. But (after some tests) it seems that the second action always evaluate only the context of the selection before the first action. Is there a possibility to evaluate the context after the first action?

Thx & kind regards,
Stefan

Re: XPath contexts in MultipleActionsOperation

Posted: Wed Mar 16, 2016 12:53 pm
by alex_jitianu
Hi Stefan,

I've tested a similar scenario similar. In my situation the second action evaluates the activation XPaths after the first action completes. I've sent you a sample framework in which I've created some actions according with your scenario. Please give it a try and tell me if there is something I've missed. Perhaps you can create a sample framework too.

Best regards,
Alex

Re: XPath contexts in MultipleActionsOperation

Posted: Fri Mar 18, 2016 8:18 pm
by stdu
Hi Alex,

thank you very much for the test framework - it works also in my installation. But my action still doesn't work and I dont know why. It is nearly the same configuration as yours in the framework?! I'll see that I create a test framework, too ...

Best regards,
Stefan

Re: XPath contexts in MultipleActionsOperation

Posted: Tue Nov 01, 2016 2:11 pm
by stdu
Hi Alex,

I picked up this topic again: I've tried your sample in the recent 18.1 oXygen Author and it didn't functioned. Can you reproduce this?

Thx & best regards,
Stefan

Re: XPath contexts in MultipleActionsOperation

Posted: Fri Nov 04, 2016 4:05 pm
by alex_jitianu
Hi Stefan,

The sample chains two actions together:
1. The first action will insert a 'b' element and will ask for the value of an attribute (uninspired called @attr).
2. The second action looks at the value of the attribute (.[@attr='A']) and if its value is 'A' it will set another attribute @other=A_value.

I tested it again and it worked as expected. What happens in your case?

Best regards,
Alex

Re: XPath contexts in MultipleActionsOperation

Posted: Fri Nov 04, 2016 9:03 pm
by stdu
Hi Alex,

thanks for testing it! In my case it produces always "@other=B_value" - also when I set @attr='A'. Weird, isn't it?

Perhaps I should try it in a plain oXygen XML Author without any new installations?

Best regards,
Stefan

Re: XPath contexts in MultipleActionsOperation

Posted: Mon Nov 07, 2016 11:31 am
by mihaela
Hi Stefan,

If you want you can send us a sample framework that reproduces your problem on our support email address (support@oxygenxml.com).

Best Regards,
Mihaela

Re: XPath contexts in MultipleActionsOperation

Posted: Mon Nov 07, 2016 6:48 pm
by stdu
Hio Alex, hi Mihaela,

after a couple of tests I found the problem:

The second action will not be executed when there is no "fall-back" operation, i.e. an operation without an XPath condition and which therefore could be executed if none of the XPath conditions of the higher prioritised operations is matched. Attention: this is indepent from wether these XPath conditions will be really fit or not!

You should be able to reproduce this behaviour in the test framework mentioned above: In the action "change" just delete the second operation (the one without an XPath condition). The action will not be executed, even if the XPath condition is matched!

A workaround is to define an operation which do nothing (for example "remove" an attribute, which isn't there).

Kind regards,
Stefan

Re: XPath contexts in MultipleActionsOperation

Posted: Tue Nov 08, 2016 3:39 pm
by mihaela
Hi Stefan,

Thank you for your explanation. I managed to reproduce the problem and I have added an issue in our internal issue tracker.
We will let you know when it will be fixed.

Best regards,
Mihaela

Re: XPath contexts in MultipleActionsOperation

Posted: Thu Apr 06, 2017 5:14 pm
by sorin_carbunaru
Hello,

Just wanted to let you know that oXygen 19.0 has just been released yesterday and the issue you reported has been fixed.

All the best wishes,
Sorin Carbunaru
oXygen XML