XPath contexts in MultipleActionsOperation

Post here questions and problems related to oXygen frameworks/document types.
stdu
Posts: 80

XPath contexts in MultipleActionsOperation

Tue Mar 15, 2016 5:14 pm

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

Re: XPath contexts in MultipleActionsOperation

Wed Mar 16, 2016 12:53 pm

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

Re: XPath contexts in MultipleActionsOperation

Fri Mar 18, 2016 8:18 pm

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

Re: XPath contexts in MultipleActionsOperation

Tue Nov 01, 2016 2:11 pm

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

Re: XPath contexts in MultipleActionsOperation

Fri Nov 04, 2016 4:05 pm

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

Re: XPath contexts in MultipleActionsOperation

Fri Nov 04, 2016 9:03 pm

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

Re: XPath contexts in MultipleActionsOperation

Mon Nov 07, 2016 11:31 am

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
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
stdu
Posts: 80

Re: XPath contexts in MultipleActionsOperation

Mon Nov 07, 2016 6:48 pm

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

Re: XPath contexts in MultipleActionsOperation

Tue Nov 08, 2016 3:39 pm

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
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
sorin_carbunaru
Site Admin
Posts: 111

Re: XPath contexts in MultipleActionsOperation

Thu Apr 06, 2017 5:14 pm

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

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 0 guests