[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: [Xslt 3 Start] Use case for Function Call Invocati

Subject: Re: [Xslt 3 Start] Use case for Function Call Invocation
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 4 Feb 2021 08:24:48 -0000
Re:  [Xslt 3 Start] Use case for Function Call Invocati
On 04.02.2021 09:07, Christophe Marchand cmarchand@xxxxxxxxxx wrote:
>
> Hello !
>
> Reading the recommandation, I was not able to imagine a use-case for
> Function Call Invocation
> <https://www.w3.org/TR/xslt-30/#invoking-initial-function>[1].
>
> Recommandation only speeks of raw result, and 2.3.5 section does not
> mention a "starting environment".
>
> Saxon implementation does not provide a command-line way to start a
> XSL with a function call invocation ; there is only an API method to
> do so. And in this case, a XDM value is return.
>
> Could W3C Xslt group members explain the motivation of such a starting
> way ?
>
> Does someone has a real use-case of this invocation ?
>
> Best regards,
> Christophe
>
> [1] : https://www.w3.org/TR/xslt-30/#invoking-initial-function
>

If you have a module/a function library you can use a function of it
with e.g.

let $xslt := <xsl:package
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
<xsl:import href="http://www.xsltfunctions.com/xsl/functx-1.0.1-nodoc.xsl"/>
<xsl:expose component="function" names="*" visibility="public"/>
</xsl:package>
return
transform(
 B B B  map {
 B B B B B B B  'stylesheet-node' : $xslt,
 B B B B B B B  'initial-function' : QName('http://www.functx.com',
'repeat-string'),
 B B B B B B B  'function-params' : ['x', 5]
 B B B  }
)?output


The XQuery part to first construct an XSLT 3 package importing the XSLT
2 functx library is only necessary as the XSLT 2 functions are otherwise
not public. If you had an XSLT 3 version of functx with public functions
you would just use the module with e.g. the transform function.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.