<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">http://www.w3.org/1999/XSL/Transform</a>"<br>             xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"<br>         xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>"<br>                xmlns:fn="<a href="http://www.w3.org/2005/xpath-functions">http://www.w3.org/2005/xpath-functions</a>"<br>                xmlns:map="<a href="http://www.w3.org/2005/xpath-functions/map">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>