Page 1 of 1
Passing XSLT stylesheet parameter to transform scenario?
Posted: Tue Apr 06, 2010 12:13 am
by dsewell
When I am creating an XSLT transformation scenario, I would like to be able to use one of the stylesheet parameters (defined in the XSLT tab) in constructing the name of the output file. So for example if I set parameter ID=X123, I would like to define "Save As" using something like
to produce the file Myfile-X123.xml.
Is this possible?
Re: Passing XSLT stylesheet parameter to transform scenario?
Posted: Tue Apr 06, 2010 12:45 pm
by adrian
Hello,
Unfortunately right now there is no editor variable that can be used to obtain what you want.
An arguable workaround would be to use an environment variable - ${env(VAR_NAME)} - or a java system variable - ${system(var.name)} - in both the stylesheet parameter value and in the "Save As" field and then set that variable before starting Oxygen. I'm not sure that's very helpful since I'm guessing you wanted a fast way to change both the parameter and the output file name.
Should I consider this a feature request(improvement)?
Regards,
Adrian
Re: Passing XSLT stylesheet parameter to transform scenario?
Posted: Tue Apr 06, 2010 4:25 pm
by dsewell
Yes, please create a feature request for a new editor variable that can use the active stylesheet parameters.
Re: Passing XSLT stylesheet parameter to transform scenario?
Posted: Wed Apr 07, 2010 4:16 pm
by adrian
Hi,
Ok, I've added this as a feature request.
We'll let you know when this gets implemented.
Thank you for the feedback.
Regards,
Adrian
Re: Passing XSLT stylesheet parameter to transform scenario?
Posted: Thu Aug 05, 2010 3:49 pm
by adrian
Hi,
There is a workaround that can help you by using a custom editor variable.
If you go to Options -> Preferences - Custom Editor Variables you can define a custom editor variable.
e.g.
Name: myParam
Value: X123
Then you can use this editor variable as the parameter's value: ${myParam}
And in the 'Save As' field: Myfile-${myParam}.xml
Then if you ned to change the value you can simply edit the value of the custom editor variable.
Regards,
Adrian