Project

Profile

Help

Bug #6676

closed

Initial template invocation with a combination of tunnel and non-tunnel parameters

Added by Debbie Lockett 6 days ago. Updated about 16 hours ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2025-01-30
Due date:
% Done:

100%

Estimated time:
Applies to branch:
12, trunk
Fix Committed on Branch:
12, trunk
Fixed in Maintenance Release:
Found in version:
Fixed in version:
SaxonC Languages:
All
SaxonC Platforms:
All
SaxonC Architecture:

Description

You can use the SaxonC C++ API to invoke a transform for a specified initial template, e.g. using XsltExecutable.callTemplateReturningValue. You can supply values for the template parameters in advance using setInitialTemplateParameters. However I think if you attempt to supply both tunnel parameters and non-tunnel parameters, it may not work correctly; because the implementation for setInitialTemplateParameters only sets itparam: parameters and a global tunnel property. I think you should be setting separate lists for tunnel (perhaps tnparam:) and non-tunnel (itparam:) parameters.

In applyXsltTransformerProperties in net.sf.saxon.option.cpp.Xslt30Processor, you should be independently setting both tunnel and non-tunnel parameters with two calls to transformer.setInitialTemplateParameters() rather than just one.

I believe the attached stylesheet will show the issue, if you attempt to run it from initial template start supplying parameter values (note the mismatch of tunnel and non-tunnel, this is intentional):

         <initial-template name="start">
            <param name="par1" tunnel="no" select="'foo1'"/>
            <param name="par2" tunnel="yes" select="'foo2'"/>
            <param name="par3" tunnel="no" select="'foo3'"/>
            <param name="par4" tunnel="yes" select="'foo4'"/>
         </initial-template>

The output should be <out>xyz1, foo2, foo3, xyz4</out>.


Files

initial-template-005.xsl (655 Bytes) initial-template-005.xsl Debbie Lockett, 2025-01-30 19:03
Actions #1

Updated by O'Neil Delpratt about 21 hours ago

  • Status changed from New to In Progress

There is no way to set both tunnel and non-tunnel parameters to the same executable. I agree with the suggested fix.

Actions #2

Updated by O'Neil Delpratt about 16 hours ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100
  • Applies to branch 12, trunk added
  • Fix Committed on Branch 12, trunk added
  • SaxonC Languages All added

Bug fix with test committed to repository

Please register to edit this issue

Also available in: Atom PDF