Page 1 of 1

Scenario with user-supplied output name

Posted: Fri Jul 10, 2015 1:32 am
by martindholmes
Hi there,

I need a scenario to work in the following way:

1. Get some user information before starting (using ${ask})

2. Pass this into the scenario, which eventually creates an output document whose name is based on one of the user input variables.

3. Open the output document in Oxygen.

I can frame this as an XSLT transformation only, or as an ant task which calls Saxon. The hard bit is getting access to that user-input supplied through ${ask} in order to get Oxygen to open the document automatically.

Any idea how I might do that?

Cheers,
Martin

Re: Scenario with user-supplied output name

Posted: Fri Jul 10, 2015 3:46 pm
by adrian
Hi,

I'm guessing (from your question on the other thread) that the output document is generated with xsl:result-document.
If that's the case, I'm afraid there is no direct way to tell Oxygen what to open when the transformation has finished.

One way to do this indirectly (with the help of the stylesheet) would be to write into a fixed file (e.g. output.xml) the name of the dynamic output filename (e.g. <filename>myfile.xml</filename>) and use the editor variable

Code: Select all

${xpath_eval(doc('output.xml')/filename/text())}
to obtain it afterwards from that file. If Oxygen is associated with .xml files, you can use the ${xpath_eval()} in the Other location field after enabling Open in Browser/System Application.

Regards,
Adrian