VextoR
VextoR

Reputation: 5165

replace function doesn't work with '$' symbol

<xsl:value-of select="replace('$@test', '$@test', '111111111111111')" />

how to make this work?

If I try to not using '$' sign everything works

<xsl:value-of select="replace('$@test', '@test', '111111111111111')" />

Upvotes: 0

Views: 950

Answers (2)

Navin Rawat
Navin Rawat

Reputation: 3138

For quick reference you may refer http://www.xml.com/pub/a/2003/06/04/tr.html

Upvotes: 0

Martin Honnen
Martin Honnen

Reputation: 167641

Try <xsl:value-of select="replace('$@test', '\$@test', '111111111111111')" />, assuming you want to treat the dollar sign literally. As it is a meta character in the regular expression language used to match the end of a string or a line to treat it literally you need to escape it.

Upvotes: 2

Related Questions