xslt 1.0 を使用して xml を変換しています。
私はこの文字列を持っています:
hello 1s: This is very nice day. 9s: Christmas is about to come 14s: and christmas preparation is just on 25s: this is awesome!!
次のようにフォーマットしたい:
hello This is very nice day. Christmas is about to come and christmas preparation is just on this is awesome!!
これを行うために、次の xslt を試しました。
<?xml version='1.0' encoding='UTF-8' ?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:regexp="http://exslt.org/regular-expressions"
extension-element-prefixes="regexp" >
<xsl:import href="regexp.xsl" />
<xsl:template match='/'>
<xsl:value-of select="regexp:replace(string(.), '[0-9]{1,4}s: ', 'g', '')" />
</xsl:template>
</xsl:stylesheet>
しかし、それを実行すると次のエラーが発生します。
java.lang.NoSuchMethodException: For extension function, could not find method java.lang.String.replace([ExpressionContext,] #STRING, #STRING, #STRING).
私は何を間違っていますか?