Project

Profile

Help

Bug #4183

closed

Cannot pass output parameters and document node parameters across the command line.

Added by Michael Caerwyn about 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Command Line
Sprint/Milestone:
-
Start date:
2019-03-27
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.9, trunk
Fix Committed on Branch:
9.9, trunk
Fixed in Maintenance Release:
Platforms:

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

Also available in: Atom PDF