Hi all, I'm trying to replace some text but can't get it right. I have a filed with a price and the output is DKK 1.000 when I use this code: <xsl:value-of select="$p1/product/priceinfo/exvat/price"/>
Now I want to replace DKK with ex. vat
My code is: <xsl:value-of select="umbraco.library:Replace('$p1/product/priceinfo/exvat/price','DKK', 'ex. vat')"/> But my output is: $p1/product/priceinfo/exvat/price
Good to hear Palle. When using the ' ', the Replace-function sees the input as a string and will not find the content from your xPath-expression. So when using xPath in the function, just remember to remove the ' '.
If you had a string tha should be replaced you would use it like this:
<xsl:value-of select="umbraco.library:Replace('This is my string','This is','Look at')" />
Replace
Hi all,
I'm trying to replace some text but can't get it right.
I have a filed with a price and the output is DKK 1.000 when I use this code:
<xsl:value-of select="$p1/product/priceinfo/exvat/price"/>
Now I want to replace DKK with ex. vat
My code is: <xsl:value-of select="umbraco.library:Replace('$p1/product/priceinfo/exvat/price','DKK', 'ex. vat')"/>
But my output is: $p1/product/priceinfo/exvat/price
Can anyone help?
Palle
Hi Palle
Culd you try without the ' ' in the first parameter like this:
/Kim A
Hi Kim,
Thanks, that did the trick.
Palle
Good to hear Palle. When using the ' ', the Replace-function sees the input as a string and will not find the content from your xPath-expression. So when using xPath in the function, just remember to remove the ' '.
If you had a string tha should be replaced you would use it like this:
The above snippet would output: Look at my string
Have a nice evening :)
/Kim A
is working on a reply...