<div dir="ltr">Interesting. fn:transform overrides the side effects in the invoked transform and returns them as a map of result documents. <div>Mba Mba Mba Mba (that's for Uche). </div><div>Not what I wanted or would expect. <br><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 11, 2021 at 12:35 PM Ihe Onwuka <<a href="mailto:ihe.onwuka@gmail.com">ihe.onwuka@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Posted on SO. It happens on Saxon 10.3 btw.<div><br></div><div><a href="https://stackoverflow.com/questions/66159827/fntransform-running-with-default-call-template-invocation-no-result-documents" target="_blank">https://stackoverflow.com/questions/66159827/fntransform-running-with-default-call-template-invocation-no-result-documents</a><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 11, 2021 at 9:27 AM Ihe Onwuka <<a href="mailto:ihe.onwuka@gmail.com" target="_blank">ihe.onwuka@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">This transform test.xsl copies (for the purpose of a small test example) a directory of XML data by calling an identity transform for each recursively encountered XML file.<div><br></div><div><xsl:stylesheet xmlns:xsl="<a href="http://www.w3.org/1999/XSL/Transform" target="_blank">http://www.w3.org/1999/XSL/Transform</a>"<br>           xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"<br>               xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a>"<br>                xmlns:fn="<a href="http://www.w3.org/2005/xpath-functions" target="_blank">http://www.w3.org/2005/xpath-functions</a>"<br>                xmlns:map="<a href="http://www.w3.org/2005/xpath-functions/map" target="_blank">http://www.w3.org/2005/xpath-functions/map</a>"<br> version="3.0" exclude-result-prefixes="xsi fn xs map" expand-text="yes"><br>   <xsl:output method="xml" indent="yes"/><br>   <xsl:strip-space elements="*"/><br>   <br>   <xsl:variable name="currentStylesheet" as="document-node()" select="doc('identity.xsl')"/><br>   <xsl:template name="xsl:initial-template"><br>      <xsl:for-each select="collection('file:///mnt/c/home/oneD/data/translatable' || '?select=*.xml;recurse=yes')"><br>         <xsl:result-document href="{replace(document-uri(),'/data/translatable/','/translated/')}"><br>              <xsl:sequence select=" fn:transform(map { <br>                                   'stylesheet-node' :  $currentStylesheet,<br>                                   'source-node'     :  .<br>                             })?output"/><br>         </xsl:result-document>                <br>      </xsl:for-each><br>   </xsl:template><br> </xsl:stylesheet><br></div><div><br></div><div>However if I invoke it from XQuery with fn:transform like so</div><div><br></div><div>xquery version "3.1";<br>fn:transform(map { 'stylesheet-node' :  doc('test.xsl')})?output <br></div><div><br></div><div>none of the result-documents are created.</div><div><br></div><div>Is there something wrong with the invoking XQuery? I have never before tried this so it is my best attempt from reading the docs. </div><div><br></div><div><br></div></div>
</blockquote></div>
</blockquote></div>