Aw: passing a function as a parameter to transform()

"Martin Honnen [email protected]" <[email protected]> Thu, 13 May 2021 21:28:02 -0000
Newsgroups gmane.text.xml.xsl.general.mulberrytech
Message-ID <[email protected]>
<html>
 <head>
  <meta name=3D"viewport" content=3D"width=3Ddevice-width">
  <meta http-equiv=3D"Content-Type" content=3D"text/vnd.ui.insecure+html;ch=
arset=3Dutf-8">
 </head>
 <body style=3D"overflow-wrap:break-word; word-break: break-word;"><div cla=
ss=3D"mail_android_message" style=3D"line-height: 1; padding: 0.5em">A func=
tion reference would be <br/>  local:get-string#2<br/><br/>--<br/>Diese Nac=
hricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.</div><d=
iv class=3D"mail_android_quote" style=3D"line-height: 1; padding: 0.3em"><h=
tml><body>Am 13.05.21, 23:05 schrieb &quot;Graydon [email protected]&quot; =
&lt;[email protected]&gt;:</body></html><blockquote c=
lass=3D"gmail_quote" style=3D"margin: 0.8ex 0pt 0pt 0.8ex; border-left: 1px=
 solid rgb(204, 204, 204); padding-left: 1ex;">

  Hello --
  <br>=20
  <br> Using Saxon 10.3 and XSLT 3.0 (from inside oXygen 23), can I pass a =
function as
  <br> a parameter to transform()?
  <br>=20
  <br> &lt;xsl:sequence select=3D"
  <br> transform(map {
  <br> 'stylesheet-location': 'tidy.xsl',
  <br> 'source-node': $tableMerge,
  <br> 'stylesheet-params': map {
  <br> QName('', 'defaultLang'): $defaultLang,
  <br> QName('', 'overrideStringMap'): $overrideStringMap,
  <br> QName('', 'lang2key2autotextMap'): $lang2key2autotextMap,
  <br> QName('local','getString') : local:getString(xs:string,xs:string)
  <br> }
  <br> })?output" /&gt;
  <br>=20
  <br> is syntactically acceptable.
  <br>=20
  <br> Inside tidy.xsl,
  <br>=20
  <br> &lt;xsl:param as=3D"xs:string" name=3D"defaultLang" /&gt;
  <br> &lt;xsl:param as=3D"map(*)" name=3D"overrideStringMap" /&gt;
  <br> &lt;xsl:param as=3D"map(*)" name=3D"lang2key2autotextMap" /&gt;
  <br> &lt;xsl:param as=3D"function(xs:string,xs:string) as xs:string" name=
=3D"local:getString" /&gt;
  <br>=20
  <br> is syntactically acceptable (though oXygen complains about the actua=
l function calls and not being able to find the function).
  <br>=20
  <br> If I run the transform, though, I get:
  <br> Engine name: Saxon-EE 10.3 (External)
  <br> Severity: error
  <br> Description: An empty sequence is not allowed as the first argument =
of local:getString()
  <br>=20
  <br> with a location that tells me the transform call parameter map is wh=
ere the error happens.
  <br>=20
  <br> Is there a way to do this? I can of course duplicate the function de=
finition but that seems improper.
  <br>=20
  <br> Thanks!
  <br>=20
  <br>=20
  <br> --=20
  <br> Graydon Saunders | [email protected]
  <br> =C3=9E=C3=A6s ofer=C3=A9ode, =C3=B0isses sw=C3=A1 m=C3=A6g.
  <br> -- Deor ("That passed, so may this.")
  <br>=20
  <br>=20
  <br>=20
 </blockquote></div></body>
</html>
<div><!-- begin bl.html.trailer -->
<div style=3D"border-top:1px solid black; background-color: #dddddd;
color: #888888; font-size: smaller; padding: 5px; text-align: center;
font-family: arial,verdana,arial,sans-serif; margin-top:1em; clear:
both; margin: auto">
<a href=3D"http://www.mulberrytech.com/xsl/xsl-list">
XSL-List info and archive</a>
<div style=3D"text-align:center;">
<a style=3D"color: blue;"
  href=3D"http://lists.mulberrytech.com/unsub/xsl-list/3329386"
>EasyUnsubscribe</a>
(<a style=3D"color: blue;"
href=3D"mailto:[email protected]?subject=3Dremove"
>by email</a>)
</div>
</div>
<!-- end bl.html.trailer --></div>