Aw: [xsl] passing a function as a parameter to transform()

Subject: Aw: [xsl] passing a function as a parameter to transform()
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 13 May 2021 21:27:56 -0000
A function reference would be
local:get-string#2

--
Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail
gesendet.Am 13.05.21, 23:05 schrieb "Graydon graydon@xxxxxxxxx"
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>:

  Hello --

  Using Saxon 10.3 and XSLT 3.0 (from inside oXygen 23), can I pass a
  function as
  a parameter to transform()?

  <xsl:sequence select="
  transform(map {
  'stylesheet-location': 'tidy.xsl',
  'source-node': $tableMerge,
  'stylesheet-params': map {
  QName('', 'defaultLang'): $defaultLang,
  QName('', 'overrideStringMap'): $overrideStringMap,
  QName('', 'lang2key2autotextMap'): $lang2key2autotextMap,
  QName('local','getString') : local:getString(xs:string,xs:string)
  }
  })?output" />

  is syntactically acceptable.

  Inside tidy.xsl,

  <xsl:param as="xs:string" name="defaultLang" />
  <xsl:param as="map(*)" name="overrideStringMap" />
  <xsl:param as="map(*)" name="lang2key2autotextMap" />
  <xsl:param as="function(xs:string,xs:string) as xs:string"
  name="local:getString" />

  is syntactically acceptable (though oXygen complains about the actual
  function calls and not being able to find the function).

  If I run the transform, though, I get:
  Engine name: Saxon-EE 10.3 (External)
  Severity: error
  Description: An empty sequence is not allowed as the first argument
  of local:getString()

  with a location that tells me the transform call parameter map is
  where the error happens.

  Is there a way to do this? I can of course duplicate the function
  definition but that seems improper.

  Thanks!

  --
  Graydon Saunders | graydonish@xxxxxxxxx
  CC&s oferC)ode, C0isses swC! mC&g.
  -- Deor ("That passed, so may this.")

XSL-List info and archiveEasyUnsubscribe (by email)

Current Thread