简体   繁体   English

XSLT 1.0:删除括号

[英]XSLT 1.0: remove parentheses

How can I remove the parentheses from this "name" sentence?如何从这个“名称”句子中删除括号?

- input - 输入

Sensor magnético (SM-1)

- transform - 转换

<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:value-of select="translate(name, $uppercase, $lowercase )" />

- output - output

sensor magnético **(** sm-1 **) <----- remove this**

You could just change:你可以改变:

<xsl:value-of select="translate(name, $uppercase, $lowercase )" />

to:至:

<xsl:value-of select="translate(name, concat($uppercase, '()'), $lowercase )" />

Or, if this is the only use for it, change the $uppercase variable to:或者,如果这是它的唯一用途,请将$uppercase变量更改为:

<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ()'" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM