summaryrefslogtreecommitdiff
path: root/xslt
diff options
context:
space:
mode:
authorFredrik Åslund <fredrik.aslund@umu.se>2013-07-08 10:00:31 +0200
committerFredrik Åslund <fredrik.aslund@umu.se>2013-07-08 10:00:31 +0200
commit45d852b7448e1a2fd84fe4d2084b1fdaf0d25a65 (patch)
treea960c99993fdb6b12b7e1143542e6e54a49185ab /xslt
parent167171da52349bd60f590038adf9afeab1f3bafe (diff)
escape | in idp summary
Diffstat (limited to 'xslt')
-rw-r--r--xslt/idp-summary.xslt29
1 files changed, 26 insertions, 3 deletions
diff --git a/xslt/idp-summary.xslt b/xslt/idp-summary.xslt
index 7e56f168..bbb88a2a 100644
--- a/xslt/idp-summary.xslt
+++ b/xslt/idp-summary.xslt
@@ -54,11 +54,15 @@
</xsl:template>
<xsl:template match="md:EmailAddress">
- <xsl:value-of select="text()"/>
+ <xsl:value-of select="text()"/><xsl:text> \\</xsl:text>
</xsl:template>
<xsl:template match="md:OrganizationDisplayName">
- <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="md:OrganizationURL">
@@ -69,8 +73,27 @@
<xsl:value-of select="text()"/><xsl:text> </xsl:text>
</xsl:template>
-
<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>