Hi Daniel, What do you get if you invoke xslt:processor() ? If it’s "Saxon EE", you should get "<root>29. März 2022</root>" as result of your query (at least that’s what I get). If it’s something else, it indicates that Saxon EE has not correctly been embedded in your Java classpath (see [1] for further information). If it’s only about formatting date, you can also run your function call within BaseX … format-date(xs:date('2022-03-29'), '[D]. [MNn] [Y]', 'de', (), ()) … but I guess that’s what you already know. Best, Christian [1] https://docs.basex.org/wiki/XSLT_Module On Fri, Apr 29, 2022 at 10:05 AM Zimmel, Daniel <D.Zimmel@esvmedien.de> wrote:
Hi,
why do I get different results with the following two queries? xslt:transform() does not respect my date picture.
Expected result:
<root>29. März 2022</root>
Query 1:
<root>{format-date(xs:date('2022-03-29'), '[D]. [MNn] [Y]', 'de', (), ())}</root>
Result: <root>29. März 2022</root>
Query 2:
declare namespace xsl = 'http://www.w3.org/1999/XSL/Transform'; let $xslt := <xsl:stylesheet version="3.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"> <xsl:template match="/"> <root> <xsl:sequence select="format-date(xs:date('2022-03-29'), '[D]. [MNn] [Y]', 'de', (), ())"/> </root> </xsl:template> </xsl:stylesheet> let $xml := <root/>
return for $xml in $xml return $xml => xslt:transform($xslt)
Result: <root>[Language: en]29. March 2022</root>
Running the XSLT with Saxon EE (not in BaseX via xslt:transform) returns (correctly):
<root>29. März 2022</root>
Using BaseX 9.5
?
Daniel