将代码定义为 XSL 2.0,但它仍像 XSL 1.0 一样运行

Issue defining code as XSL 2.0 but it still functions as XSL 1.0

我希望这是一个愚蠢的用户错误 - 但是 - 我有一个应该使用 XSL 2.0 的 XSLT 文件 - 但是,每当我尝试使用 XSL 2.0 函数(例如 replace())时,我都会收到错误消息说函数无法识别

System.Xml.Xsl.XsltException: 'replace()' is an unknown XSLT function.

我将此错误解释为文件未正确定义或作为 XSL 2.0 处理,但不确定我做错了什么。

以下是我构建版本的方式:

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns="http://www.w3.org/1999/xhtml">

只是为了确保有答案:您使用的 XSLT 处理器 (System.Xml.Xsl) 不支持 XSLT 2.0。