Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Generate a members.xml variant for the legacy CMS.
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed Jul 14, 2016
1 parent cb58919 commit fff5f37
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
26 changes: 25 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
<!--
Standard processing: generate, sign, then verify.
-->
<target name="process" depends="get.keystore.pass, generate, sign, verify">
<target name="process" depends="get.keystore.pass, generate, sign, verify, generate.members.cms">
<echo>Processing complete.</echo>
</target>

Expand Down Expand Up @@ -266,6 +266,7 @@
knownhosts="${known.hosts}">
<fileset dir="${xml.dir}">
<include name="members.xml"/>
<include name="members-cms.xml"/>
<include name="ukfederation-members.xsd"/>
<include name="ukfederation-stats.html"/>
<include name="${md.cms.unsigned}"/>
Expand Down Expand Up @@ -361,6 +362,29 @@
<echo>Verification completed.</echo>
</target>

<!--
*************************
*** ***
*** M E M B E R S ***
*** ***
*************************
-->

<!--
generate.members.cms
Produce a variant of the members.xml file suitable for
consumption by the legacy CMS.
-->
<target name="generate.members.cms">
<echo>Generating CMS version of members.xml</echo>
<XALAN
i="${xml.dir}/members.xml"
o="${xml.dir}/members-cms.xml"
x="${mdx.dir}/uk/members-cms.xsl"/>
<echo>Generated CMS version of members.xml</echo>
</target>

<!--
*************************************************
*** ***
Expand Down
41 changes: 41 additions & 0 deletions mdx/uk/members-cms.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
members-cms.xsl
Tweak the members.xml document so that it can be consumed by the legacy CMS.
-->
<xsl:stylesheet version="1.0"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:members="http://ukfederation.org.uk/2007/01/members"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="members">

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

<!--
Remove ID attributes from Member and DomainOwner elements.
-->
<xsl:template match="members:Member/@ID">
<!-- nothing -->
</xsl:template>
<xsl:template match="members:DomainOwner/@ID">
<!-- nothing -->
</xsl:template>

<!--By default, copy text blocks, comments and attributes unchanged.-->
<xsl:template match="text()|comment()|@*">
<xsl:copy/>
</xsl:template>

<!--By default, copy all elements from the input to the output, along with their attributes and contents.-->
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

0 comments on commit fff5f37

Please sign in to comment.