summaryrefslogtreecommitdiff
path: root/xslt
diff options
context:
space:
mode:
authorFredrik Åslund <fredrik.aslund@umu.se>2013-06-28 12:39:09 +0200
committerFredrik Åslund <fredrik.aslund@umu.se>2013-06-28 12:39:09 +0200
commit793093717acfee2c273c9e00550a68a54b3c93a2 (patch)
tree581848ff3abd278c4494e9b6d76f28cafc7587d6 /xslt
parenta3a252254dfcddfd492ae01f4a6c4cc3591963b9 (diff)
replace | with \| in ServiceName
Diffstat (limited to 'xslt')
-rw-r--r--xslt/sp-summary.xslt26
1 files changed, 25 insertions, 1 deletions
diff --git a/xslt/sp-summary.xslt b/xslt/sp-summary.xslt
index c0360ad8..7708cf19 100644
--- a/xslt/sp-summary.xslt
+++ b/xslt/sp-summary.xslt
@@ -53,7 +53,11 @@
</xsl:template>
<xsl:template match="md:ServiceName">
- <xsl:value-of select="text()"/>
+ <xsl:call-template name="string-replace-all">
+ <xsl:with-param name="text" select="text()" />
+ <xsl:with-param name="replace" select="'|'" />
+ <xsl:with-param name="by" select="'\|'" />
+ </xsl:call-template>
</xsl:template>
<xsl:template match="samla:AttributeValue">
@@ -93,4 +97,24 @@
<xsl:template match="*"/>
<xsl:template match="text()"/>
+ <xsl:template name="string-replace-all">
+ <xsl:param name="text" />
+ <xsl:param name="replace" />
+ <xsl:param name="by" />
+ <xsl:choose>
+ <xsl:when test="contains($text, $replace)">
+ <xsl:value-of select="substring-before($text,$replace)" />
+ <xsl:value-of select="$by" />
+ <xsl:call-template name="string-replace-all">
+ <xsl:with-param name="text" select="substring-after($text,$replace)" />
+ <xsl:with-param name="replace" select="$replace" />
+ <xsl:with-param name="by" select="$by" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$text" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
</xsl:stylesheet>