Created
September 15, 2013 16:35
-
-
Save ijy/6572314 to your computer and use it in GitHub Desktop.
XSLT 1.0 search and replace template.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| SEARCH & REPLACE | |
| string: The text to be evaluated | |
| search: The character or string to look for in the above string | |
| replace: What to replace it with | |
| The output will neatly concatenate the string with replacements made. | |
| --> | |
| <xsl:template name="search-and-replace"> | |
| <xsl:param name="string" /> | |
| <xsl:param name="search" /> | |
| <xsl:param name="replace" /> | |
| <xsl:value-of select="concat(substring-before($string, $search), $replace, substring-after($string, $search))" /> | |
| </xsl:template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment