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

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

Upvotes: 2

Views: 254

Answers (1)

michael.hor257k
michael.hor257k

Reputation: 117102

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:

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

Upvotes: 2

Related Questions