[oXygen-user] Custom action to process a document and update an element?

Wendell Piez wapiez at wendellpiez.com
Mon Nov 25 09:49:29 CST 2013


Hi George,

On Fri, Nov 22, 2013 at 11:03 AM, George Cristian Bina
<george at oxygenxml.com> wrote:
> You cannot read and write in XSLT the same file.

Indeed.

> However, if your XSLT takes the document as input and outputs the
> transformed document then there is nothing that stops you from configuring
> the output of the transformation scenario to be the current file, use ${cf}
> in the "Save As" field of the Output tab when you setup the transformation
> scenario.
>
> Then, you can apply your processing by double clicking on the scenario in
> the Transformation Scenarios dialog - the nice effect of this is that the
> content in the editor will be automatically refreshed with the change, as we
> check this and load automatically the file from disk if it is changed - just
> make sure the file is saved before invoking the transformation, otherwise
> you will be asked if you want to reload the content from disk. The added
> bonus is that you also have undo support after you perform the change you
> can easily go back to the previous state if you are unhappy with the new
> document content.

Nice tip: I will try this.

Of course this is a delicate operation. In some ways XSLT is not
suited to the task, since (as you note) the architecture isn't
designed to support it. By the time you've set up all the tooling, you
may as well do it the old-fashioned way. (Whatever you consider that
to be. :-)

Cheers, Wendell

Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^


More information about the oXygen-user mailing list