summaryrefslogtreecommitdiff
path: root/xslt
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2015-07-09 00:35:17 +0200
committerLeif Johansson <leifj@sunet.se>2015-07-09 00:35:17 +0200
commit3b4f4f5a542210919703afa3129a602888ddd9ec (patch)
tree0c4c9be2f11be3dbd3a2efd9f1c7f6748a9c024c /xslt
parentc516d662665caf6d9e34c76f5e48e76567123e4e (diff)
try harder to normalize entityIDs
Diffstat (limited to 'xslt')
-rw-r--r--xslt/import-metadata.xsl12
1 files changed, 10 insertions, 2 deletions
diff --git a/xslt/import-metadata.xsl b/xslt/import-metadata.xsl
index 8d68a425..5a99c8bd 100644
--- a/xslt/import-metadata.xsl
+++ b/xslt/import-metadata.xsl
@@ -19,9 +19,17 @@
<xsl:template match="md:EntityDescriptor">
<!-- xsl:param name="output"/ -->
- <xsl:variable name="uri"><xsl:value-of select="substring-after(@entityID,'://')"/></xsl:variable>
+ <xsl:variable name="uri">
+ <xsl:choose>
+ <xsl:when test="contains(@entityID,'://')">
+ <xsl:value-of select="substring-after(@entityID,'://')"/>
+ </xsl:when>
+ <xsl:otherwise><xsl:value-of select="@entityID"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
<xsl:variable name="host">
- <xsl:value-of select="translate($uri,'/?=','---')"/>
+ <xsl:value-of select="normalize-space(translate($uri,'/?=:','----'))"/>
</xsl:variable>
<xsl:variable name="file" select="concat($output,'/',$host,'.xml')"/>
<exsl:document method="xml" indent="yes" href="{$file}">