XPath contexts in MultipleActionsOperation

Post here questions and problems related to oXygen frameworks/document types.
stdu
Posts: 81
Joined: Mon Mar 05, 2012 5:23 pm

XPath contexts in MultipleActionsOperation

Post 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
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: XPath contexts in MultipleActionsOperation

Post 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
stdu
Posts: 81
Joined: Mon Mar 05, 2012 5:23 pm

Re: XPath contexts in MultipleActionsOperation

Post 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
stdu
Posts: 81
Joined: Mon Mar 05, 2012 5:23 pm

Re: XPath contexts in MultipleActionsOperation

Post 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
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: XPath contexts in MultipleActionsOperation

Post 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
stdu
Posts: 81
Joined: Mon Mar 05, 2012 5:23 pm

Re: XPath contexts in MultipleActionsOperation

Post 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
mihaela
Posts: 490
Joined: Wed May 20, 2009 2:40 pm

Re: XPath contexts in MultipleActionsOperation

Post 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
Mihaela Calotescu
http://www.oxygenxml.com
stdu
Posts: 81
Joined: Mon Mar 05, 2012 5:23 pm

Re: XPath contexts in MultipleActionsOperation

Post 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
mihaela
Posts: 490
Joined: Wed May 20, 2009 2:40 pm

Re: XPath contexts in MultipleActionsOperation

Post 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
Mihaela Calotescu
http://www.oxygenxml.com
sorin_carbunaru
Posts: 402
Joined: Mon May 09, 2016 9:37 am

Re: XPath contexts in MultipleActionsOperation

Post 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
Post Reply