[xquery-talk] fn:transform running with default call-template invocation - no result-documents created
Ihe Onwuka <[email protected]> Thu, 11 Feb 2021 09:27:09 -0500
| Newsgroups | gmane.text.xml.x-query.general,gmane.text.xml.xsl.general.mulberrytech |
|---|---|
| Message-ID | <CALfs7+yuaEjFQ-G48MUes0PmVCQ8P-SYhesRDBbtNCVsQufo3Q@mail.gmail.com> |
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.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:map="http://www.w3.org/2005/xpath-functions/map"
version="3.0" exclude-result-prefixes="xsi fn xs map" expand-text="yes">
<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:variable name="currentStylesheet" as="document-node()"
select="doc('identity.xsl')"/>
<xsl:template name="xsl:initial-template">
<xsl:for-each
select="collection('file:///mnt/c/home/oneD/data/translatable' ||
'?select=*.xml;recurse=yes')">
<xsl:result-document
href="{replace(document-uri(),'/data/translatable/','/translated/')}">
<xsl:sequence select=" fn:transform(map {
'stylesheet-node' : $currentStylesheet,
'source-node' : .
})?output"/>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
However if I invoke it from XQuery with fn:transform like so
xquery version "3.1";
fn:transform(map { 'stylesheet-node' : doc('test.xsl')})?output
none of the result-documents are created.
Is there something wrong with the invoking XQuery? I have never before
tried this so it is my best attempt from reading the docs.
_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk