In XSLT 2 or 3 you have the replace
function:
<xsl:template match="ol/li[ends-with(normalize-space(.), '.')]">
<xsl:copy>
<xsl:value-of select="replace(., '.s*$', '')"/>
</xsl:copy>
</xsl:template>
In XSLT 1 enviroments you can often call into the underlying platform (e.g. Java or .NET or PHP or Python) to make use of similar string functions supporting regular expressions like .s*$
to match on the end of a string preceded by zero or more whitespace characters preceded by a single full stop character.
Or try to do it all with pure XPath 1 string functions
<xsl:template match="ol/li[substring(normalize-space(), string-length(normalize-space())) = '.']">
<xsl:copy>
<xsl:value-of select="substring(normalize-space(), 1, string-length(normalize-space()) - 1)"/>
</xsl:copy>
</xsl:template>
In all cases, handle copying other stuff through by the identity transformation template: https://xsltfiddle.liberty-development.net/jxNakAW
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…