<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--

	import.xsl
	
	XSL stylesheet that takes a SAML 2 metadata file containing
	an EntityDescriptor from some other system (e.g., metadata
	generated automatically by a Shibboleth installation) and
	adjusts it towards the standard used for a UK federation
	metadata repository fragment file.
	
	Assumptions:
	
	* the output will have oXygen's "format and indent" applied
	via the Eclipse plug-in.  This means that output format doesn't
	need to be particularly precise.
	
	* the metadata comes from a UK federation member
	
	* the metadata most likely represents a Shibboleth 2.x entity
	
	
	Author: <NAME> <<EMAIL>>

-->
<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:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi"
	xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui"
	xmlns:shibmd="urn:mace:shibboleth:metadata:1.0"
	xmlns:ukfedlabel="http://ukfederation.org.uk/2006/11/label"
	
	xmlns:date="http://exslt.org/dates-and-times"
	xmlns:mdxDates="xalan://uk.ac.sdss.xalan.md.Dates"
	xmlns:mdxTextUtils="xalan://uk.ac.sdss.xalan.md.TextUtils"
	extension-element-prefixes="date mdxDates mdxTextUtils"

	xmlns:xalan="http://xml.apache.org/xalan"
	
	exclude-result-prefixes="idpdisc init md mdui xalan"
	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">

	<!--
		Force UTF-8 encoding for the output.
	-->
	<xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8"
		indent="yes" xalan:indent-amount="4"
	/>

	<xsl:strip-space elements="md:EntityDescriptor"/>
	
	<!--
		Top-level EntityDescriptor element.
	-->
	<xsl:template match="md:EntityDescriptor">
		<xsl:text>&#10;</xsl:text>
		<EntityDescriptor ID="uk000000_CHANGE_THIS"
			xsi:schemaLocation="urn:oasis:names:tc:SAML:2.0:metadata ../xml/saml-schema-metadata-2.0.xsd
			urn:oasis:names:tc:SAML:metadata:algsupport ../xml/sstc-saml-metadata-algsupport-v1.0.xsd
			urn:oasis:names:tc:SAML:metadata:rpi ../xml/saml-metadata-rpi-v1.0.xsd
			urn:oasis:names:tc:SAML:metadata:ui ../xml/sstc-saml-metadata-ui-v1.0.xsd
			urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol ../xml/sstc-saml-idp-discovery.xsd
			urn:oasis:names:tc:SAML:profiles:SSO:request-init ../xml/sstc-request-initiation.xsd
			urn:mace:shibboleth:metadata:1.0 ../xml/shibboleth-metadata-1.0.xsd
			http://ukfederation.org.uk/2006/11/label ../xml/uk-fed-label.xsd
			http://www.w3.org/2001/04/xmlenc# ../xml/xenc-schema.xsd
			http://www.w3.org/2009/xmlenc11# ../xml/xenc-schema-11.xsd
			http://www.w3.org/2000/09/xmldsig# ../xml/xmldsig-core-schema.xsd">
			
			<!--
				Copy across the @entityID attribute.  Other attributes from the input document
				are discarded.
			-->
			<xsl:attribute name="entityID"><xsl:value-of select="@entityID"/></xsl:attribute>

			<!--
				Entity comment.
			-->
			<!-- <xsl:text>&#10;</xsl:text> -->
			<xsl:text>&#10;</xsl:text>
			<xsl:comment>
				<xsl:text>&#10;</xsl:text>
				<xsl:text>        *** ENTITY COMMENT GOES HERE ***</xsl:text>
				<xsl:text>&#10;</xsl:text>
				<xsl:text>    </xsl:text>
			</xsl:comment>

			<!--
				Always have an Extensions element.  This may combine new material with any material
				present in an existing Extensions element.
			-->
			<Extensions>
				
				<!--
					Pull up scopes from role descriptor if they are not
					already present at the entity level.
				-->
				<xsl:if test="not(md:Extensions/shibmd:Scope)">
					<xsl:apply-templates select="md:IDPSSODescriptor/md:Extensions/shibmd:Scope"/>
				</xsl:if>
				
				<!--
					Always assumed to be owned by a member of the UK federation.
				-->
				<ukfedlabel:UKFederationMember/>

				<!--
					Dummy elements to include for IdPs only.
				-->
				<xsl:if test="md:IDPSSODescriptor">
					<xsl:comment> *** VERIFY OR REMOVE THE FOLLOWING ELEMENT *** </xsl:comment>
					<ukfedlabel:AccountableUsers/>
					<xsl:comment> *** VERIFY OR REMOVE THE FOLLOWING ELEMENT *** </xsl:comment>
					<wayf:HideFromWAYF xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF"/>
				</xsl:if>

				<!--
					Dummy Software element.
				-->
				<ukfedlabel:Software name="*** FILL IN ***"
					version="2" fullVersion="*** FILL IN OR REMOVE ***"><commit_msg>Treat version the same as fullVersion, and provide obviously default text to reduce the chance of it being left at the default by accident.<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--

	import.xsl
	
	XSL stylesheet that takes a SAML 2 metadata file containing
	an EntityDescriptor from some other system (e.g., metadata
	generated automatically by a Shibboleth installation) and
	adjusts it towards the standard used for a UK federation
	metadata repository fragment file.
	
	Assumptions:
	
	* the output will have oXygen's "format and indent" applied
	via the Eclipse plug-in.  This means that output format doesn't
	need to be particularly precise.
	
	* the metadata comes from a UK federation member
	
	* the metadata most likely represents a Shibboleth 2.x entity
	
	
	Author: <NAME> <<EMAIL>>

-->
<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:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi"
	xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui"
	xmlns:shibmd="urn:mace:shibboleth:metadata:1.0"
	xmlns:ukfedlabel="http://ukfederation.org.uk/2006/11/label"
	
	xmlns:date="http://exslt.org/dates-and-times"
	xmlns:mdxDates="xalan://uk.ac.sdss.xalan.md.Dates"
	xmlns:mdxTextUtils="xalan://uk.ac.sdss.xalan.md.TextUtils"
	extension-element-prefixes="date mdxDates mdxTextUtils"

	xmlns:xalan="http://xml.apache.org/xalan"
	
	exclude-result-prefixes="idpdisc init md mdui xalan"
	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">

	<!--
		Force UTF-8 encoding for the output.
	-->
	<xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8"
		indent="yes" xalan:indent-amount="4"
	/>

	<xsl:strip-space elements="md:EntityDescriptor"/>
	
	<!--
		Top-level EntityDescriptor element.
	-->
	<xsl:template match="md:EntityDescriptor">
		<xsl:text>&#10;</xsl:text>
		<EntityDescriptor ID="uk000000_CHANGE_THIS"
			xsi:schemaLocation="urn:oasis:names:tc:SAML:2.0:metadata ../xml/saml-schema-metadata-2.0.xsd
			urn:oasis:names:tc:SAML:metadata:algsupport ../xml/sstc-saml-metadata-algsupport-v1.0.xsd
			urn:oasis:names:tc:SAML:metadata:rpi ../xml/saml-metadata-rpi-v1.0.xsd
			urn:oasis:names:tc:SAML:metadata:ui ../xml/sstc-saml-metadata-ui-v1.0.xsd
			urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol ../xml/sstc-saml-idp-discovery.xsd
			urn:oasis:names:tc:SAML:profiles:SSO:request-init ../xml/sstc-request-initiation.xsd
			urn:mace:shibboleth:metadata:1.0 ../xml/shibboleth-metadata-1.0.xsd
			http://ukfederation.org.uk/2006/11/label ../xml/uk-fed-label.xsd
			http://www.w3.org/2001/04/xmlenc# ../xml/xenc-schema.xsd
			http://www.w3.org/2009/xmlenc11# ../xml/xenc-schema-11.xsd
			http://www.w3.org/2000/09/xmldsig# ../xml/xmldsig-core-schema.xsd">
			
			<!--
				Copy across the @entityID attribute.  Other attributes from the input document
				are discarded.
			-->
			<xsl:attribute name="entityID"><xsl:value-of select="@entityID"/></xsl:attribute>

			<!--
				Entity comment.
			-->
			<!-- <xsl:text>&#10;</xsl:text> -->
			<xsl:text>&#10;</xsl:text>
			<xsl:comment>
				<xsl:text>&#10;</xsl:text>
				<xsl:text>        *** ENTITY COMMENT GOES HERE ***</xsl:text>
				<xsl:text>&#10;</xsl:text>
				<xsl:text>    </xsl:text>
			</xsl:comment>

			<!--
				Always have an Extensions element.  This may combine new material with any material
				present in an existing Extensions element.
			-->
			<Extensions>
				
				<!--
					Pull up scopes from role descriptor if they are not
					already present at the entity level.
				-->
				<xsl:if test="not(md:Extensions/shibmd:Scope)">
					<xsl:apply-templates select="md:IDPSSODescriptor/md:Extensions/shibmd:Scope"/>
				</xsl:if>
				
				<!--
					Always assumed to be owned by a member of the UK federation.
				-->
				<ukfedlabel:UKFederationMember/>

				<!--
					Dummy elements to include for IdPs only.
				-->
				<xsl:if test="md:IDPSSODescriptor">
					<xsl:comment> *** VERIFY OR REMOVE THE FOLLOWING ELEMENT *** </xsl:comment>
					<ukfedlabel:AccountableUsers/>
					<xsl:comment> *** VERIFY OR REMOVE THE FOLLOWING ELEMENT *** </xsl:comment>
					<wayf:HideFromWAYF xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF"/>
				</xsl:if>

				<!--
					Dummy Software element.
				-->
				<ukfedlabel:Software name="*** FILL IN ***"
					version="*** FILL IN OR REMOVE ***" fullVersion="*** FILL IN OR REMOVE ***">
{'fraction_non_alphanumeric': 0.16475427581727647, 'fraction_numerical': 0.022623944576748215, 'mean_word_length': 3.903927813163482, 'pattern_counts': {'":': 0, '<': 109, '<?xml version=': 2, '>': 109, 'https://': 0, 'lorem ipsum': 0, 'www.': 12, 'xml': 74}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2437624', 'n_tokens_mistral': 4075, 'n_tokens_neox': 3369, 'n_words': 599}