xproc / 3.0-steps

Repository for change requests to the standard step library and for official extension steps
10 stars 7 forks source link

Is p:xslt for XSLT 3.0 able to handle static parameters? #363

Closed martin-honnen closed 4 years ago

martin-honnen commented 4 years ago

In XSLT 3 a new feature of static parameters was introduced where you can declare e.g. <xsl:param name="param1" static="yes" as="xs:string" select="'foo | bar'"/> and then you can use them in so called shadow attributes e.g. <xsl:template _match="{$param1}">...</xsl:template>.

Is p:xslt for XSLT version 3.0 supposed to be able to allow setting such static parameters with its parameters option?

I think, for instance for Saxon 9.9, this requires setting them on the compiler before you compile the XSLT code and not on the Xslt30Transformer before you apply-templates or call-template, as you can do with normal parameters.

gimsieke commented 4 years ago

Independent of how the XProc processors compile/invoke XSLT, there is probably currently no way to pass static parameters to p:xslt. We probably need to introduce a new map option static-parameters for p:xslt whose value is ignored for XSLT versions less than 3. Whether XProc processors that claim to support XSLT 3 are required to “do the right thing” with them or whether support is implementation-defined needs to be discussed, primarily between Achim and Norm.

xatapult commented 4 years ago

We're going to add a static-parameters to p:xslt

gimsieke commented 4 years ago

@ndw Is there an RNC for the steps somewhere?

ndw commented 4 years ago

No. The RELAX NG grammar for steps is generated automatically from the p:declare-step declaration. If you, for example, add a new parameter there, it will automatically be reflected in the RNC/RNG for XProc 3.0.

gimsieke commented 4 years ago

Ok, then @xatapult can “do the needful” all by himself

ndw commented 4 years ago

Yes, indeed. Sorry that went right past me on the call yesterday.