Bug #4183
closedCannot pass output parameters and document node parameters across the command line.
100%
Description
Good Afternoon,
I am writing some XSLT tests and need to pass in a parameter that is an XML chunk. Reading the command line documentation I found that +param= is suppose to load and parse a file, perfect for what I need. Trying it didn't work for net.sf.saxon.Transform. I could not even get it to error with a "File Not Found" error if I misspelled the file name.
Downloading the source code I found the following:
The entry point Transform.java calling main, calls doTransform, which calls setActualOptions in trans/CommandLineOptions.java. That sets up paramFiles with the correct param names, and the associated filename/directoryname/URI.
paramFiles is processed in trans/CommandLineOptions.java in setParams, but that function is never called from Transform, it is only called from Query. Instead some parameters are being set by applyStaticParams, which is also in CommandLineOptions.java, which is for XSLT 3.0 (according to the comment) and does half the job of setParams, it sets the simple params -- paramValues, and the expression params, the ones starting with ?, paramExpressions.
applyStaticParams is called from Transform just before loading the source file. Since SetParams is never called, and applyStaticParams does only "half" the job my document node param is never setup.
I am not sure how you would like to solve this, whether changing the code or the documentation, so I do not want to offer any code changes, but I would really like to be able to use the +param= function, it would solve my testing problem.
Thank you for your time, - Michael Caerwyn
Please register to edit this issue