Hi,
calling the test-xsl function does not work (might be a bug). I think returning a document fragment from xsl is not forbidden (at least exist-db permits it).
The transform itself uses Saxon HE but this seems not related.
-- start xqm --
xquery version "3.0";
module namespace _= "http://foo.org/test"; import module namespace xslt = "http://basex.org/modules/xslt";
declare variable $_:DATA := <foo> <bar1></bar1> <bar2></bar2> </foo>;
declare variable $_:XSL := <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform%22%3E <xsl:output method="xhtml"/> <xsl:template match="/*/*"> <div>some div</div> </xsl:template> </xsl:stylesheet>;
declare %rest:GET %rest:path("test-xsl") function _:test-xsl(){
let $out := xslt:transform($_:DATA, $_:XSL) return $out
};
--- end xqm --
Message:
Stopped at test-xsl.xqm, 26/31: [FODC0002] "" (Line 2): Markup im Dokument nach dem Root-Element muss ordnungsgemäß formatiert sein.
Regards, Max