Re: [oXygen-user] Interactively ask the user for a param value

Wendell Piez wrote: Hi Wendell,
On the other hand, I wondered whether it could be useful to have a macro that would open a dialog box allowing me to select the XML input file when running a scenario on a stylesheet -- in which case a macro that would let me parameterize the output by the input would be really useful.
I think there are two orthogonal things here: the convenient user input facility (besides plain strings, you can use a select file dialog box, but also a calendar selection, etc.) And in addition, you can either give the data in the scenario, or ask for interactive input each time the scenario is run. I was asking for the second feature here (interactive input,) but sure, I think the first one (different input methods) is very interesting too! Regards, -- Florent Georges http://www.fgeorges.org/

Hello, We are thinking of adding a macro for user input, something like: ${ask(message, type, default_value)} Example: ${ask('Please enter you special file path parameter', file, 'c:\input.xml')} ${ask('Please enter you password', password)} If an XSLT/XQuery parameter or another value from a transformation scenario contains such a macro, oXygen will expand the value by asking the user to enter a value. The user will be asked each time the scenario is executed. Wendell, do you need something else? Do you want to bind the user input to a certain variable and then use it later? There could be problems, since the evaluation order is not guaranteed. Cheers, Dan Georges wrote:
Wendell Piez wrote:
Hi Wendell,
On the other hand, I wondered whether it could be useful to have a macro that would open a dialog box allowing me to select the XML input file when running a scenario on a stylesheet -- in which case a macro that would let me parameterize the output by the input would be really useful.
I think there are two orthogonal things here: the convenient user input facility (besides plain strings, you can use a select file dialog box, but also a calendar selection, etc.) And in addition, you can either give the data in the scenario, or ask for interactive input each time the scenario is run.
I was asking for the second feature here (interactive input,) but sure, I think the first one (different input methods) is very interesting too!
Regards,

Dan, At 04:36 AM 7/28/2009, you wrote:
We are thinking of adding a macro for user input, something like:
${ask(message, type, default_value)}
Example: ${ask('Please enter you special file path parameter', file, 'c:\input.xml')} ${ask('Please enter you password', password)}
Slick.
If an XSLT/XQuery parameter or another value from a transformation scenario contains such a macro, oXygen will expand the value by asking the user to enter a value. The user will be asked each time the scenario is executed.
... while, I guess, the 'type' keyword indicates what sort of info should be forthcoming, and therefore what sort of support oXygen might offer for providing it (file chooser dialog, etc.).
Wendell, do you need something else? Do you want to bind the user input to a certain variable and then use it later? There could be problems, since the evaluation order is not guaranteed.
My original idea would be covered by this. Then there are the more complicated possibilities prompted by Eliot's request. For example, could the result file name then be something like 'out/${tsfn}.xml' (where ${tsfn} is "transformation source file name, without extension")? I can see how more exotic variants, like having the output name depend on a runtime parameter, could be pretty far out there. Cheers, Wendell ====================================================================== Wendell Piez mailto:wapiez@mulberrytech.com Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
participants (3)
-
Dan Caprioara
-
Florent Georges
-
Wendell Piez