Removing or adding two attributes at the same time

Hi all, For an oXygen framework (DocBook), I would like to exectue an operation that removes or adds two attributes at the same time after the user has clicked on a button. The use case is that in my DocBook customization these attributes need to appear at the same time. Adding or removing just one of them would make the file invalid, and having two buttons is not an option, because there are many such combined attributes, the GUI would get too full. The ChangeAttributeOperation at http://www.oxygenxml.com/doc/ug-oxygen/index.html#topics/dg-default-author-o... didn't work for me since I cannot have two of these operations associated with one button. Looking at http://www.oxygenxml.com/doc/ug-oxygen/index.html#topics/the-action-dialog.h... it seems not possible to trigger two operations via one action: "An action has one or mode operation modes. The evaluation of an XPath expression activates an operation mode. The first enabled operation mode is activated when you trigger the action." I also tried to evoke an XSLT transformation via XSLTOperation that removes the attributes. But although the "script" value IMO opinion points to the right location of the XSLT and that XSLT file is valid, I get an error from evoking the action, saying: "Couldn't exectute operation ro.sync.ecss.extensions.commons.operations.TransformOperation because ... cannot create Transformer: failed to compile stylesheet." Any ideas how to move forward? If the XSLTOperation is the way to go: is there an example in an existing framework that demonstrates how the operation is used? Thanks, Felix

Hi Felix, I think the XsltOperation is the best/easiest way to go. The reason why it is not working for you is probably that you filled the parameter "script" not with the actual script but with the path to an xsl file (I did the same on my first try). If you want to hold your script in a separate file just import it from there. For a custom framework with a folder xsl it would look like: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version= "2.0"> <xsl:import href="xsl/MyTransformation.xsl"/> </xsl:stylesheet> Regards, Patrik ------------------------------------------------------------------ Systemarchitektur & IT-Projekte Tel: +49 40 33449-1142 Fax: +49 40 33449-1400 E-Mail: patrik.stellmann@gdv-dl.de Von: Felix Sasaki <fsasaki@w3.org> An: oxygen-user@oxygenxml.com Datum: 09.11.2013 10:52 Betreff: [oXygen-user] Removing or adding two attributes at the same time Gesendet von: oxygen-user-bounces@oxygenxml.com Hi all, For an oXygen framework (DocBook), I would like to exectue an operation that removes or adds two attributes at the same time after the user has clicked on a button. The use case is that in my DocBook customization these attributes need to appear at the same time. Adding or removing just one of them would make the file invalid, and having two buttons is not an option, because there are many such combined attributes, the GUI would get too full. The ChangeAttributeOperation at http://www.oxygenxml.com/doc/ug-oxygen/index.html#topics/dg-default-author-o... didn't work for me since I cannot have two of these operations associated with one button. Looking at http://www.oxygenxml.com/doc/ug-oxygen/index.html#topics/the-action-dialog.h... it seems not possible to trigger two operations via one action: "An action has one or mode operation modes. The evaluation of an XPath expression activates an operation mode. The first enabled operation mode is activated when you trigger the action." I also tried to evoke an XSLT transformation via XSLTOperation that removes the attributes. But although the "script" value IMO opinion points to the right location of the XSLT and that XSLT file is valid, I get an error from evoking the action, saying: "Couldn't exectute operation ro.sync.ecss.extensions.commons.operations.TransformOperation because ... cannot create Transformer: failed to compile stylesheet." Any ideas how to move forward? If the XSLTOperation is the way to go: is there an example in an existing framework that demonstrates how the operation is used? Thanks, Felix _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user GDV Dienstleistungs-GmbH & Co. KG Glockengießerwall 1 D-20095 Hamburg www.gdv-dl.de Sitz und Registergericht: Hamburg HRA 93 894 USt.-IdNr : DE 205183123 Komplementärin: GDV Beteiligungsgesellschaft mbH Sitz und Registergericht: Hamburg HRB 71 153 Geschäftsführer: Volker Sonnenburg Heiko Beermann ------------------------------------------------------------------ Diese E-Mail und alle Anhänge enthalten vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der E-Mail ist nicht gestattet. This e-mail and any attached files may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distributionof the material in this e-mail is strictly forbidden.

Hi Felix, In addition to Patrik's useful response, just to answer some of your original questions:
it seems not possible to trigger two operations via one action: "An action has one or mode operation modes. The evaluation of an XPath expression activates an operation mode. The first enabled operation mode is activated when you trigger the action."
Indeed, only one operation can be triggered in a certain XPath activation context. So besides using the XSLT Operation you could also implement a custom Java operation to set both attributes to the current element using our API.
Any ideas how to move forward? If the XSLTOperation is the way to go: is there an example in an existing framework that demonstrates how the operation is used?
A small example configuring an XSLT Operation can be found here: http://www.oxygenxml.com/doc/ug-oxygen/topics/dg-default-author-operations.h... Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 11/9/2013 11:51 AM, Felix Sasaki wrote:
Hi all,
For an oXygen framework (DocBook), I would like to exectue an operation that removes or adds two attributes at the same time after the user has clicked on a button.
The use case is that in my DocBook customization these attributes need to appear at the same time. Adding or removing just one of them would make the file invalid, and having two buttons is not an option, because there are many such combined attributes, the GUI would get too full.
The ChangeAttributeOperation at http://www.oxygenxml.com/doc/ug-oxygen/index.html#topics/dg-default-author-o... didn't work for me since I cannot have two of these operations associated with one button.
Looking at http://www.oxygenxml.com/doc/ug-oxygen/index.html#topics/the-action-dialog.h... it seems not possible to trigger two operations via one action: "An action has one or mode operation modes. The evaluation of an XPath expression activates an operation mode. The first enabled operation mode is activated when you trigger the action."
I also tried to evoke an XSLT transformation via XSLTOperation that removes the attributes. But although the "script" value IMO opinion points to the right location of the XSLT and that XSLT file is valid, I get an error from evoking the action, saying: "Couldn't exectute operation ro.sync.ecss.extensions.commons.operations.TransformOperation because ... cannot create Transformer: failed to compile stylesheet."
Any ideas how to move forward? If the XSLTOperation is the way to go: is there an example in an existing framework that demonstrates how the operation is used?
Thanks,
Felix _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Thanks a lot, Radu and Patrick. Indeed Patrick described my mistake and the XSLT call is working fine now. Best, Felix Am 11.11.13 11:09, schrieb Oxygen XML Editor Support:
Hi Felix,
In addition to Patrik's useful response, just to answer some of your original questions:
it seems not possible to trigger two operations via one action: "An action has one or mode operation modes. The evaluation of an XPath expression activates an operation mode. The first enabled operation mode is activated when you trigger the action." Indeed, only one operation can be triggered in a certain XPath activation context. So besides using the XSLT Operation you could also implement a custom Java operation to set both attributes to the current element using our API.
Any ideas how to move forward? If the XSLTOperation is the way to go: is there an example in an existing framework that demonstrates how the operation is used? A small example configuring an XSLT Operation can be found here:
http://www.oxygenxml.com/doc/ug-oxygen/topics/dg-default-author-operations.h...
Regards, Radu
Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 11/9/2013 11:51 AM, Felix Sasaki wrote:
Hi all,
For an oXygen framework (DocBook), I would like to exectue an operation that removes or adds two attributes at the same time after the user has clicked on a button.
The use case is that in my DocBook customization these attributes need to appear at the same time. Adding or removing just one of them would make the file invalid, and having two buttons is not an option, because there are many such combined attributes, the GUI would get too full.
The ChangeAttributeOperation at http://www.oxygenxml.com/doc/ug-oxygen/index.html#topics/dg-default-author-o... didn't work for me since I cannot have two of these operations associated with one button.
Looking at http://www.oxygenxml.com/doc/ug-oxygen/index.html#topics/the-action-dialog.h... it seems not possible to trigger two operations via one action: "An action has one or mode operation modes. The evaluation of an XPath expression activates an operation mode. The first enabled operation mode is activated when you trigger the action."
I also tried to evoke an XSLT transformation via XSLTOperation that removes the attributes. But although the "script" value IMO opinion points to the right location of the XSLT and that XSLT file is valid, I get an error from evoking the action, saying: "Couldn't exectute operation ro.sync.ecss.extensions.commons.operations.TransformOperation because ... cannot create Transformer: failed to compile stylesheet."
Any ideas how to move forward? If the XSLTOperation is the way to go: is there an example in an existing framework that demonstrates how the operation is used?
Thanks,
Felix _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hi Felix, We will consider updating the XSLTOperation to allow also setting a URL to an XSLT script instead of the XSLT content. We can do this either by automatically detecting that you added a file instead of XSLT code or we can add an additional parameter to the operation, for example scriptURL. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 11/11/13, 2:55 PM, Felix Sasaki wrote:
Thanks a lot, Radu and Patrick. Indeed Patrick described my mistake and the XSLT call is working fine now.
Best,
Felix
Am 11.11.13 11:09, schrieb Oxygen XML Editor Support:
Hi Felix,
In addition to Patrik's useful response, just to answer some of your original questions:
it seems not possible to trigger two operations via one action: "An action has one or mode operation modes. The evaluation of an XPath expression activates an operation mode. The first enabled operation mode is activated when you trigger the action." Indeed, only one operation can be triggered in a certain XPath activation context. So besides using the XSLT Operation you could also implement a custom Java operation to set both attributes to the current element using our API.
Any ideas how to move forward? If the XSLTOperation is the way to go: is there an example in an existing framework that demonstrates how the operation is used? A small example configuring an XSLT Operation can be found here:
http://www.oxygenxml.com/doc/ug-oxygen/topics/dg-default-author-operations.h...
Regards, Radu
Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 11/9/2013 11:51 AM, Felix Sasaki wrote:
Hi all,
For an oXygen framework (DocBook), I would like to exectue an operation that removes or adds two attributes at the same time after the user has clicked on a button.
The use case is that in my DocBook customization these attributes need to appear at the same time. Adding or removing just one of them would make the file invalid, and having two buttons is not an option, because there are many such combined attributes, the GUI would get too full.
The ChangeAttributeOperation at http://www.oxygenxml.com/doc/ug-oxygen/index.html#topics/dg-default-author-o... didn't work for me since I cannot have two of these operations associated with one button.
Looking at http://www.oxygenxml.com/doc/ug-oxygen/index.html#topics/the-action-dialog.h... it seems not possible to trigger two operations via one action: "An action has one or mode operation modes. The evaluation of an XPath expression activates an operation mode. The first enabled operation mode is activated when you trigger the action."
I also tried to evoke an XSLT transformation via XSLTOperation that removes the attributes. But although the "script" value IMO opinion points to the right location of the XSLT and that XSLT file is valid, I get an error from evoking the action, saying: "Couldn't exectute operation ro.sync.ecss.extensions.commons.operations.TransformOperation because ... cannot create Transformer: failed to compile stylesheet."
Any ideas how to move forward? If the XSLTOperation is the way to go: is there an example in an existing framework that demonstrates how the operation is used?
Thanks,
Felix _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (4)
-
Felix Sasaki
-
George Cristian Bina
-
Oxygen XML Editor Support
-
Patrik.Stellmann@gdv-dl.de