Xml 如何删除一段带有氚的javascript文本?

Xml 如何删除一段带有氚的javascript文本?,xml,xpath,find,tritium,Xml,Xpath,Find,Tritium,我有一段氚文本,用来删除一段javascript代码 # to remove an inline js code based on text search $("//script[contains(text(),'textiwanttoremove')]") { text(){ replace('thetextiwanttoremove','') } } 但是,此代码不起作用。我犯了个错误 Fail

我有一段氚文本,用来删除一段javascript代码

  # to remove an inline js code based on text search
      $("//script[contains(text(),'textiwanttoremove')]") {
          text(){
              replace('thetextiwanttoremove','')
          }
      }
但是,此代码不起作用。我犯了个错误

Failed to create body.ts transformer: 
scripts/main.ts:13: function Text.$(Text) does not exist in namespace tritium; (called from Text.with(Regexp)).

另外,如果我将文本替换为内部,它仍然不起作用,谢谢。

您好,请验证mixer.loc文件中是否存在mixer stdlib,然后尝试使用以下替换:

这应该行得通

胡安·卡米洛

 $(".//script[contains(text(), 'txt2remove')]") {
    text() {
      replace(/txt2remove/, '') 
    }
 }