EXSLT正規表現関数が必要な場合は、Pythonで記述された4Suiteを使用する必要があります。Saxonはこの拡張機能を認識していませんが、XSLT 2.0プロセッサであるため、regexp:testの代わりにfn:matchesを使用できます。http://www.w3.org/TR/xslt20/を参照してください。
もう1つの方法は、独自の拡張関数を定義することです。
サクソン人:
<xsl:stylesheet
version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:regexp="http://exslt.org/regular-expressions"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xsl:function name="regexp:test" as="xs:boolean">
<xsl:param name="regexp" as="xs:string"/>
<xsl:param name="str" as="xs:string"/>
<xsl:sequence select="fn:matches($regexp, $str)"/>
</xsl:function>
</xsl:stylesheet>
Xalanの場合:
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:regexp="http://exslt.org/regular-expressions"
xmlns:func="http://exslt.org/functions"
xmlns:java="http://xml.apache.org/xalan/java"
extension-element-prefixes="func java regexp"
>
<func:function name="regexp:test">
<xsl:param name="regexp"/>
<xsl:param name="str"/>
<xsl:variable name="testResult" select="java:matches($regexp, $str)"/>
<func:result select="$testResult"/>
</func:function>
</xsl:stylesheet>
http://xml.apache.org/xalan-j/extensions.html