Skip to content

Commit

Permalink
Remove mdui:Logo elements containing data: URLs from CDS-all aggregate.
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed Jul 27, 2015
1 parent 0f72981 commit 1774d5c
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
22 changes: 22 additions & 0 deletions mdx/common-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,28 @@
</property>
</bean>

<!--
stripMDUILogoData
Remove all mdui:Logo elements containing data: URLs.
-->
<bean id="stripMDUILogoData" parent="XSLTransformationStage"
p:id="stripMDUILogoData">
<property name="XSLResource">
<bean parent="ClassPathResource" c:_="strip-mdui-logo-data.xsl"/>
</property>
</bean>

<!--
stripEmptyMDUIUIInfo
Remove any empty mdui:UIInfo container elements.
-->
<bean id="stripEmptyMDUIUIInfo" parent="EmptyContainerStrippingStage"
p:id="stripEmptyMDUIUIInfo">
<property name="elementNamespace" ref="mdui_namespace"/>
<property name="elementName" value="UIInfo"/>
</bean>

<!--
*****************************************************
Expand Down
32 changes: 32 additions & 0 deletions mdx/strip-mdui-logo-data.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
strip-mdui-logo-data.xsl
Remove all mdui:Logo elements containing data: URLs.
-->
<xsl:stylesheet version="1.0"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

<!--
Remove all mdui:Logo elements containing data: URLs.
-->
<xsl:template match="mdui:Logo[starts-with(., 'data:')]"/>

<!--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>
6 changes: 6 additions & 0 deletions mdx/uk/generate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,12 @@
<!-- remove many things that the CDS doesn't look at -->
<ref bean="CDSStripUnwanted"/>

<!--
Remove embedded images used in mdui:Logo elements.
-->
<ref bean="stripMDUILogoData"/>
<ref bean="stripEmptyMDUIUIInfo"/>

<ref bean="CDSFinalise"/>
<ref bean="CDSNormaliseNamespaces"/>

Expand Down

0 comments on commit 1774d5c

Please sign in to comment.