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-operations.html
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.html#the-action-dialog
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.