How to replace “single quote” to “double single quote” in XSLT

Question:

How do you replace an xml value, for example:

to:

via XSLT?

I need this because I have to pass this value in a powershell command line and to other platforms since the “double single quote” is needed to escape the apostrophe/single quotes.

Answer:

Assuming an XSLT 1.0 processor, you will need to use a recursive named template for this, e.g:

Example of call:

Source:

How to replace “single quote” to “double single quote” in XSLT by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply