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

Reply via email to