This repository has been archived by the owner. It is now read-only.
forked from InCommon/inc-meta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate normalisation transforms for export and export preview
- Loading branch information
Showing
3 changed files
with
120 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| ns_norm_export_preview.xsl | ||
| Normalise the namespaces in the export preview aggregate. | ||
| The strategy is to define the most commonly-used prefixes in the document element. | ||
| Prefixes which are less often used, but which may be used by container elements | ||
| (e.g., mdui:) or for attributes are normalised to use a prefix, but not declared | ||
| on the document element. | ||
| Prefixes which are less often used and are only used for non-containers can be | ||
| normalised to non-prefix use (i.e., to redefine the default namespace) if required | ||
| to cut the numbers down. | ||
| Author: Ian A. Young <ian@iay.org.uk> | ||
| --> | ||
| <xsl:stylesheet version="1.0" | ||
| xmlns:alg="urn:oasis:names:tc:SAML:metadata:algsupport" | ||
| xmlns:ds="http://www.w3.org/2000/09/xmldsig#" | ||
| xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol" | ||
| xmlns:init="urn:oasis:names:tc:SAML:profiles:SSO:request-init" | ||
| xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" | ||
| xmlns:mdattr="urn:oasis:names:tc:SAML:metadata:attribute" | ||
| xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi" | ||
| xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui" | ||
| xmlns:remd="http://refeds.org/metadata" | ||
| xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" | ||
| xmlns:shibmd="urn:mace:shibboleth:metadata:1.0" | ||
| xmlns:ukfedlabel="http://ukfederation.org.uk/2006/11/label" | ||
| xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF" | ||
|
|
||
| exclude-result-prefixes="alg md mdattr saml ukfedlabel wayf" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
| xmlns="urn:oasis:names:tc:SAML:2.0:metadata"> | ||
|
|
||
|
|
||
| <!-- | ||
| Import templates for basic normalisation. | ||
| --> | ||
| <xsl:import href="../ns_norm.xsl"/> | ||
|
|
||
|
|
||
| <!-- | ||
| Force UTF-8 encoding for the output. | ||
| --> | ||
| <xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8"/> | ||
|
|
||
|
|
||
| <!-- | ||
| ******************************************* | ||
| *** *** | ||
| *** D O C U M E N T E L E M E N T *** | ||
| *** *** | ||
| ******************************************* | ||
| --> | ||
|
|
||
|
|
||
| <!-- | ||
| We need to handle the document element specially in order to arrange | ||
| for all appropriate namespace prefix definitions to appear on it. | ||
| There are only two possible document elements in SAML metadata. | ||
| --> | ||
|
|
||
|
|
||
| <!-- | ||
| Document element is <EntityDescriptor>. | ||
| --> | ||
| <xsl:template match="/md:EntityDescriptor"> | ||
| <EntityDescriptor> | ||
| <xsl:apply-templates select="node()|@*"/> | ||
| </EntityDescriptor> | ||
| </xsl:template> | ||
|
|
||
| <!-- | ||
| Document element is <EntitiesDescriptor>. | ||
| --> | ||
| <xsl:template match="/md:EntitiesDescriptor"> | ||
| <EntitiesDescriptor> | ||
| <xsl:apply-templates select="node()|@*"/> | ||
| </EntitiesDescriptor> | ||
| </xsl:template> | ||
|
|
||
|
|
||
| <!-- | ||
| ************************************* | ||
| *** *** | ||
| *** A L G N A M E S P A C E *** | ||
| *** *** | ||
| ************************************* | ||
| --> | ||
|
|
||
|
|
||
| <!-- | ||
| alg:* | ||
| Normalise namespace to not use a prefix. | ||
| --> | ||
| <xsl:template match="alg:*"> | ||
| <xsl:element name="{local-name()}" namespace="urn:oasis:names:tc:SAML:metadata:algsupport"> | ||
| <xsl:apply-templates select="node()|@*"/> | ||
| </xsl:element> | ||
| </xsl:template> | ||
|
|
||
|
|
||
| </xsl:stylesheet> |