Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
XSLT-替换字符串中的多个字符_Xslt_Xslt 1.0 - Fatal编程技术网

XSLT-替换字符串中的多个字符

XSLT-替换字符串中的多个字符,xslt,xslt-1.0,Xslt,Xslt 1.0,我有下面的字符串 ';#6;#' 上面的字符串可以是任何内容,例如: ';#1;#' or ';#2;#' , or ';#3;#' ... 我需要能够替换'和' 在XSLT 1.0中使用类似于translate的功能是否可行?使用子字符串和concat函数。在XSLT 1.0中,这类操作相当困难。看看www.exslt.org上提供的字符串处理函数库-其中一些函数带有XSLT实现,您可以将其复制到样式表中并调用(通常为xsl:call模板)。您可能会替换所有字符串,为什么不直接像'rep

我有下面的字符串

';#6;#' 
上面的字符串可以是任何内容,例如:

';#1;#' or ';#2;#' , or ';#3;#' ...
我需要能够替换
'
'


在XSLT 1.0中使用类似于translate的功能是否可行?

使用
子字符串
concat
函数。

在XSLT 1.0中,这类操作相当困难。看看www.exslt.org上提供的字符串处理函数库-其中一些函数带有XSLT实现,您可以将其复制到样式表中并调用(通常为xsl:call模板)。

您可能会替换所有字符串,为什么不直接像
'replace'
那样重写文本呢?请更清楚一些。使用XSLT1.0并需要字符串处理的人应该使用样式表中包含的标准附加模板,不要再纠结于如何“重新发明轮子”。