How to modify attributes with editor variables?

<oXygen/> general issues.
avanlooveren
Posts: 25

How to modify attributes with editor variables?

Tue Oct 24, 2017 5:13 am

I need to replace all attributes with a particular name in a single document to have a value of UUID (the editor variable "{uuid}"). I don't think Find/Replace, even with regex, is capable of this.

I'm trying to configure a custom Author action with ChangeAttributeOperation, but I wonder if I'm going about this all wrong. I set the elementLocation to "//*", but I cannot seem to get more than one attribute value to update.

Any help appreciated. Also, is it possible to enable this in Text mode? Thanks!
sorin_carbunaru
Site Admin
Posts: 111

Re: How to modify attributes with editor variables?

Tue Oct 24, 2017 5:20 pm

Hello,

You could use a custom XML Refactoring operation (https://www.oxygenxml.com/doc/versions/ ... tions.html). I did just that to see if it works (and it does work), starting from the default Add/Change attribute operation, and instead of requesting an attribute value from the user, I generated one in the operation's XQuery script, using the generate-id() function.

You can find my try at http://www.oxygenxml.com/forum/files/custom%20change%20attributes.zip.

Best regards,
Sorin Carbunaru
oXygen XML

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 0 guests