Skip to content

Commit

Permalink
Add a fragment processing stage to the UK collect flow. Make it remov…
Browse files Browse the repository at this point in the history
…e xsi:schemaLocation attributes.
  • Loading branch information
iay committed Jun 10, 2011
1 parent 4c0aeaf commit aa012eb
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
49 changes: 49 additions & 0 deletions mdx/uk/fragment.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
fragment.xsl
XSL stylesheet to perform any required clean-up on a UK federation fragment file
before it is passed along to other processes.
-->
<xsl:stylesheet version="1.0"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"

xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xsi xsl">

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


<!--
Remove any xsi:schemaLocation attributes.
-->
<xsl:template match="@xsi:schemaLocation"/>


<!--
*********************************************
*** ***
*** D E F A U L T T E M P L A T E S ***
*** ***
*********************************************
-->


<!--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>
17 changes: 17 additions & 0 deletions mdx/uk/uk-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,21 @@
</property>
</bean>


<!--
processFragment
This stage performs any standard cleanup required for UK federation fragment files.
-->
<bean id="processFragment" class="net.shibboleth.metadata.dom.XSLTransformationStage"
init-method="initialize" lazy-init="true">
<property name="id" value="processFragment"/>
<property name="xslResource">
<bean class="org.opensaml.util.resource.FilesystemResource">
<constructor-arg value="#{ systemProperties['basedir'] }/mdx/uk/fragment.xsl"/>
</bean>
</property>
</bean>


</beans>
1 change: 1 addition & 0 deletions mdx/uk/uk-collect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
<list>
<ref bean="fetchUkFragmentFiles"/>
<ref bean="filterDeletedEntities"/>
<ref bean="processFragment"/>
<ref bean="checkSchemas"/>
<ref bean="CHECK.std"/>
<ref bean="errorAnnouncingFilter"/><!-- should be fatal -->
Expand Down

0 comments on commit aa012eb

Please sign in to comment.