| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Copyright (c) 2005, 2007 IBM Corporation and others. |
| All rights reserved. This program and the accompanying materials |
| are made available under the terms of the Eclipse Public License v1.0 |
| which accompanies this distribution, and is available at |
| http://www.eclipse.org/legal/epl-v10.html |
| Contributors: |
| IBM Corporation - initial implementation |
| --> |
| |
| <xsl:stylesheet version="1.0" |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
| |
| <xsl:template name="escape"> |
| <xsl:param name="string"/> |
| <xsl:param name="search"/> |
| <xsl:param name="replace"/> |
| <xsl:choose> |
| <xsl:when test="contains($string, $search)"> |
| <xsl:value-of select="concat(substring-before($string, $search), $replace)"/> |
| <xsl:call-template name="escape"> |
| <xsl:with-param name="string" select="substring-after($string, $search)"/> |
| <xsl:with-param name="search" select="$search"/> |
| <xsl:with-param name="replace" select="$replace"/> |
| </xsl:call-template> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:value-of select="$string"/> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:template> |
| |
| </xsl:stylesheet> |