On 02/12/2025 14:54, Martin Honnen wrote:

Hi,

I have seen that support for the XPath 3.1 random-number-generator function has landed in the Xalan XSLT 3.0 development branch.

I am wondering whether the XPath 3.1 lookup operator "?" should work with a map returned by a call to random-number-generator.


For me, for instance,

<xsl:value-of select="random-number-generator(current-dateTime())?number"/>

fails with FOTY0013 : Cannot do an XPath atomization of a map with Xalan, while that code works fine with Saxon.



Another test that fails with Xalan but works with Saxon:


<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  version="3.0"
  xmlns:xs="http://www.w3.org/2001/XMLSchema";
  xmlns:map="http://www.w3.org/2005/xpath-functions/map";
  xmlns:array="http://www.w3.org/2005/xpath-functions/array";
  exclude-result-prefixes="#all"
  expand-text="yes">

  <xsl:template match="/*">
    <xsl:copy>
      <xsl:iterate select="1 to 5">
        <xsl:param name="rng" select="random-number-generator(current-dateTime())"/>
        <xsl:sequence select="$rng('number')"/>
        <xsl:next-iteration>
          <xsl:with-param name="rng" select="$rng('next')()"/>
        </xsl:next-iteration>
      </xsl:iterate>
      <xsl:comment>Run with {system-property('xsl:vendor')} at {current-dateTime()}</xsl:comment>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>

With Xalan I get fatalError: XPTY0004 : Number of arguments required for XPath dynamic function call is 0. Arguments provided : 1.

Reply via email to