summaryrefslogtreecommitdiff
path: root/xslt/sp-summary.xslt
blob: 8f1e8241eadb28214261d6ae4d4999063a97a5d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?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:mdattr="urn:oasis:names:tc:SAML:metadata:attribute"
		xmlns:samla="urn:oasis:names:tc:SAML:2.0:assertion"
                xmlns:exsl="http://exslt.org/common"
                extension-element-prefixes="exsl"
                xmlns:shibmd="urn:mace:shibboleth:metadata:1.0">

  <xsl:output method="text"/>
  <xsl:variable name="eol">
<xsl:text>|</xsl:text><xsl:text>
</xsl:text>
  </xsl:variable>
  
  <xsl:template name="entity-name">
    <xsl:variable name="h"><xsl:value-of select="substring-after(@entityID,'://')"/></xsl:variable>
    <xsl:if test="contains($h,'/')">
      <xsl:value-of select="substring-before($h,'/')"/>
    </xsl:if>
    <xsl:if test="not(contains($h,'/'))">
      <xsl:value-of select="$h"/>
    </xsl:if> 
  </xsl:template>

  <xsl:template match="/md:EntitiesDescriptor">
    <xsl:text>||EntityID||Service Name||Service Description||Organization||Technical Contact||Administrative Contact||Entity Categories||
</xsl:text>
    <xsl:apply-templates select="md:EntityDescriptor[md:SPSSODescriptor]"/>
  </xsl:template>

  <xsl:template match="md:EntityDescriptor">
     <xsl:text> | </xsl:text><xsl:value-of select="@entityID"/>
     <xsl:text> | </xsl:text><xsl:apply-templates select="md:SPSSODescriptor/md:AttributeConsumingService/md:ServiceName"/>
     <xsl:text> | </xsl:text><xsl:apply-templates select="md:SPSSODescriptor/md:AttributeConsumingService/md:ServiceDescription"/>
     <xsl:text> | </xsl:text><xsl:apply-templates select="md:Organization"/>
     <xsl:text> | </xsl:text><xsl:apply-templates select="md:ContactPerson[@contactType='technical']"/>
     <xsl:text> | </xsl:text><xsl:apply-templates select="md:ContactPerson[@contactType='administrative']"/>
     <xsl:text> | </xsl:text><xsl:apply-templates select="md:Extensions/mdattr:EntityAttributes/samla:Attribute[@Name='http://macedir.org/entity-category']/samla:AttributeValue"/><xsl:text> |
</xsl:text>
  </xsl:template>

  <xsl:template match="md:AttributeConsumingService">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="md:ServiceDescription">
    <xsl:value-of select="normalize-space(text())"/><xsl:text> </xsl:text>
  </xsl:template>

  <xsl:template match="md:ServiceName">
    <xsl:value-of select="text()"/>
  </xsl:template>

  <xsl:template match="samla:AttributeValue">
    <xsl:value-of select="substring-after(text(),'/category/')"/><xsl:text> </xsl:text>
  </xsl:template> 

  <xsl:template match="md:ContactPerson">
    <xsl:apply-templates select="md:EmailAddress"/><xsl:text> </xsl:text>
  </xsl:template> 

  <xsl:template match="md:Organization">
    <xsl:text>[</xsl:text>
    <xsl:apply-templates select="md:OrganizationDisplayName[1]"/><xsl:text>|</xsl:text><xsl:apply-templates select="md:OrganizationURL[1]"/><xsl:text>]</xsl:text>
  </xsl:template>

  <xsl:template match="md:SPPSSODescriptor">
    <xsl:apply-templates select="md:Extensions/shibmd:Scope"/>
  </xsl:template>

  <xsl:template match="md:EmailAddress">
     <xsl:value-of select="text()"/>
  </xsl:template>

  <xsl:template match="md:OrganizationDisplayName">
     <xsl:value-of select="normalize-space(text())"/>
  </xsl:template>

  <xsl:template match="md:OrganizationURL">
     <xsl:value-of select="normalize-space(text())"/>
  </xsl:template>

  <xsl:template match="shibmd:Scope">
     <xsl:value-of select="text()"/><xsl:text> </xsl:text>
  </xsl:template>


  <xsl:template match="*"/>
  <xsl:template match="text()"/>

</xsl:stylesheet>