summaryrefslogtreecommitdiff
path: root/xslt/import-metadata.xsl
diff options
context:
space:
mode:
authorBjörn Mattsson <bjorn@sunet.se>2023-03-06 11:22:05 +0100
committerBjörn Mattsson <bjorn@sunet.se>2023-03-06 11:22:05 +0100
commit467dbdbf3d7212e25ee69daeaadd8adba7c7c5b8 (patch)
treed3576d5f2d4b5cc676c0a12ef8f8c3c83b474bf5 /xslt/import-metadata.xsl
parentbc1d55080e5d42e6ef2bba892d640aa8f68bbc90 (diff)
Moved files to make ths repo signed
Diffstat (limited to 'xslt/import-metadata.xsl')
-rw-r--r--xslt/import-metadata.xsl83
1 files changed, 0 insertions, 83 deletions
diff --git a/xslt/import-metadata.xsl b/xslt/import-metadata.xsl
deleted file mode 100644
index 2edf7ed2..00000000
--- a/xslt/import-metadata.xsl
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:shibmeta="urn:mace:shibboleth:metadata:1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
- xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
- xmlns:exsl="http://exslt.org/common"
- extension-element-prefixes="exsl"
- xmlns:shibmd="urn:mace:shibboleth:metadata:1.0">
-
- <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
-
- <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:template match="/md:EntitiesDescriptor">
- <xsl:apply-templates select="md:EntityDescriptor">
- <!-- xsl:with-param name="output"><xsl:value-of select="$output"/></xsl:with-param -->
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="md:EntityDescriptor">
- <!-- xsl:param name="output"/ -->
- <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="hostStr">
- <xsl:call-template name="string-replace-all">
- <xsl:with-param name="text" select="$uri" />
- <xsl:with-param name="replace" select="'%2F'" />
- <xsl:with-param name="by" select="'/'" />
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="host">
- <xsl:value-of select="normalize-space(translate($hostStr,'/?=:','----'))"/>
- </xsl:variable>
- <xsl:variable name="file" select="concat($output,'/',$host,'.xml')"/>
- <exsl:document method="xml" indent="yes" href="{$file}">
- <xsl:copy>
- <xsl:apply-templates select="node()|@*"/>
- </xsl:copy>
- </exsl:document>
- </xsl:template>
-
- <xsl:template match="@ID"/>
- <xsl:template match="ds:Signature"/>
-
- <xsl:template match="text()|comment()|@*">
- <xsl:copy/>
- </xsl:template>
-
- <xsl:template match="*">
- <xsl:copy>
- <xsl:apply-templates select="node()|@*"/>
- </xsl:copy>
- </xsl:template>
-
-</xsl:stylesheet>