diff options
-rw-r--r-- | xslt/import-metadata.xsl | 12 |
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}"> |