EXSLT modules available?

Which EXSLT modules are currently implemented in origam as namespace? I only know about dates and times module.

All should be supported and then some (which are non-standard and I couldn’t find documentation for, these are with the shortcut ending with 2, e.g. “str2”).

A quick list taken from here:

  • math
  • date
  • regexp
  • str
  • set
  • random
  • date2
  • math2
  • regexp2
  • set2
  • str2
  • dyn2

So it should work, but when I try to add for example math namespace to transformation definition and wants to use any function e.g. math:random(), I get an error during transformation validation.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
	xmlns:AS="http://schema.advantages.cz/AsapFunctions"
	xmlns:date="http://exslt.org/dates-and-times"
	xmlns:math="http://exslt.org/math"
    exclude-result-prefixes="AS date math">
	<xsl:template match="ROOT">
		<ROOT>
		<xsl:attribute name="test"><xsl:value-of select="math:random()"/></xsl:attribute>
		</ROOT>
	</xsl:template>
</xsl:stylesheet>

error message in output window in architect:

Cannot find a script or an extension object associated with namespace 'http://exslt.org/math'.
Transformation result invalid.
Exception happened during transformation. See inner exception for details:

Cannot find a script or an extension object associated with namespace 'http://exslt.org/math'.

@tvavrda please could you double check all EXSLT namespaces are really implemented?
thank you.

What ORIGAM version are you using?

2022.1 and 2022.3 (for testing)

You are right. We recently added support of all of them to XPath function but in XSLT it remains limited to dates, strings and regex. See:

Could you add EXSLT support for all namespaces to XSLT as well?

Made a request Add all EXSLT namespaces

To find a namespaces URL I needed to open source code of Origam in Visual Studio and find the namespaces URLs to address it in xmlns element. Here is the list for a quick reference:

exslt.org extension functions documentation: EXSLT - Dates and Times

for gotdotnet.com functions I can’t find reference but at least for dyn2:evaluate works the same as stated in documentation of dynamic on page EXSLT - Dynamic.