Skip to content

Commit

Permalink
Properly include both OrgName and OrgDisplayName
Browse files Browse the repository at this point in the history
  • Loading branch information
nckroy committed Oct 15, 2020
1 parent eff1882 commit 5eee5ea
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions lib/list_all_IdPs_csv.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,41 @@

<!-- output the heading line -->
<xsl:template match="/">
<xsl:text>Organization Name,IdP Display Name,IdP Entity ID,Registrar ID</xsl:text>
<xsl:text>Organization Name,Organization Display Name,IdP Display Name,IdP Entity ID,Registrar ID</xsl:text>
<xsl:text>&#x0a;</xsl:text>
<xsl:apply-templates/>
</xsl:template>

<!-- match all entity descriptors with an IdP role -->
<xsl:template match="//md:EntityDescriptor[md:IDPSSODescriptor]">

<!-- compute the normalized values of mdui:DisplayName and md:OrganizationDisplayName -->
<!-- compute the normalized values of mdui:DisplayName, md:OrganizationDisplayName and md:OrganizationName -->
<xsl:variable name="displayName" select="normalize-space(md:IDPSSODescriptor/md:Extensions/mdui:UIInfo/mdui:DisplayName[@xml:lang='en'])"/>
<xsl:variable name="orgDisplayName" select="normalize-space(md:Organization/md:OrganizationDisplayName[@xml:lang='en'])"/>

<xsl:variable name="orgName" select="normalize-space(md:Organization/md:OrganizationName[@xml:lang='en'])"/>

<!-- output md:OrganizationName or "NONE" -->
<xsl:choose>
<xsl:when test="$orgName != ''">
<!-- escape literal double quotes in md:OrganizationDisplayName -->
<xsl:variable name="escapedOrgName">
<xsl:call-template name="string-replace-all">
<xsl:with-param name="string" select="$orgName"/>
<xsl:with-param name="search" select="$double_quote"/>
<xsl:with-param name="replace" select="$double_double_quote"/>
</xsl:call-template>
</xsl:variable>
<xsl:text>"</xsl:text>
<xsl:value-of select="$escapedOrgName"/>
<xsl:text>"</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>NONE</xsl:text>
</xsl:otherwise>
</xsl:choose>

<!-- output md:OrganizationDisplayName or "NONE" -->
<xsl:text>,</xsl:text>
<xsl:choose>
<xsl:when test="$orgDisplayName != ''">
<!-- escape literal double quotes in md:OrganizationDisplayName -->
Expand Down

0 comments on commit 5eee5ea

Please sign in to comment.