[prev in list] [next in list] [prev in thread] [next in thread]
List: xsl-list
Subject: Aw:=?UTF-8?B?wqA=?=[xsl] passing a function as a parameter to transform()
From: "Martin Honnen martin.honnen () gmx ! de" <xsl-list-service () lists ! mulberrytech ! com>
Date: 2021-05-13 21:28:21
Message-ID: 20210513172755.a18b5a96 () lists ! mulberrytech ! com
[Download RAW message or body]
<html>
<head>
<meta name="viewport" content="width=device-width">
<meta http-equiv="Content-Type" content="text/vnd.ui.insecure+html;charset=utf-8">
</head>
<body style="overflow-wrap:break-word; word-break: break-word;"><div \
class="mail_android_message" style="line-height: 1; padding: 0.5em">A function \
reference would be <br/> local:get-string#2<br/><br/>--<br/>Diese Nachricht wurde \
von meinem Android Mobiltelefon mit GMX Mail gesendet.</div><div \
class="mail_android_quote" style="line-height: 1; padding: 0.3em"><html><body>Am \
13.05.21, 23:05 schrieb "Graydon graydon@marost.ca" \
<xsl-list-service@lists.mulberrytech.com>:</body></html><blockquote \
class="gmail_quote" style="margin: 0.8ex 0pt 0pt 0.8ex; border-left: 1px solid \
rgb(204, 204, 204); padding-left: 1ex;">
Hello --
<br>
<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>
<br> <xsl:sequence select="
<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" />
<br>
<br> is syntactically acceptable.
<br>
<br> Inside tidy.xsl,
<br>
<br> <xsl:param as="xs:string" name="defaultLang" />
<br> <xsl:param as="map(*)" name="overrideStringMap" />
<br> <xsl:param as="map(*)" name="lang2key2autotextMap" />
<br> <xsl:param as="function(xs:string,xs:string) as xs:string" \
name="local:getString" /> <br>
<br> is syntactically acceptable (though oXygen complains about the actual function \
calls and not being able to find the function). <br>
<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>
<br> with a location that tells me the transform call parameter map is where the \
error happens. <br>
<br> Is there a way to do this? I can of course duplicate the function definition \
but that seems improper. <br>
<br> Thanks!
<br>
<br>
<br> --
<br> Graydon Saunders | graydonish@gmail.com
<br> Þæs oferéode, ðisses swá mæg.
<br> -- Deor ("That passed, so may this.")
<br>
<br>
<br>
</blockquote></div></body>
</html>
<div><!-- begin bl.html.trailer -->
<div style="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="http://www.mulberrytech.com/xsl/xsl-list">
XSL-List info and archive</a>
<div style="text-align:center;">
<a style="color: blue;"
href="http://lists.mulberrytech.com/unsub/xsl-list/651070"
> EasyUnsubscribe</a>
(<a style="color: blue;"
href="mailto:xsl-list-unsub@lists.mulberrytech.com?subject=remove"
> by email</a>)
</div>
</div>
<!-- end bl.html.trailer --></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic