Skip to content

Commit

Permalink
Stop using Mail.dodgyAddress from sdss-xalan-md project
Browse files Browse the repository at this point in the history
Replace Xalan-based EmailAddress validation with a new EmailAddressStringValidator and StringElementValidationStage stage from ukf-mda.
See ukf/ukf-meta#139.
  • Loading branch information
iay committed Feb 25, 2020
1 parent a88a38f commit e8583f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 14 additions & 0 deletions mdx/uk/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,19 @@
<bean id="check_uk_keydesc_key" parent="mda.XSLValidationStage"
p:XSLResource="classpath:uk/check_uk_keydesc_key.xsl"/>

<!--
check_uk_email
Check that md:EmailAddress elements match our format, as
described by the EmailAddressStringValidator. In particular,
this requires the "mailto:" scheme."
-->
<bean id="check_uk_email" parent="ukf.StringElementValidationStage"
p:elementName-ref="md-EmailAddress">
<property name="validators">
<bean id="format" parent="ukf.EmailAddressStringValidator"/>
</property>
</bean>

<!--
check_uk_extensions
Expand Down Expand Up @@ -365,6 +378,7 @@
<bean id="check_ukfedlabel" parent="mda.XSLValidationStage"
p:XSLResource="classpath:uk/check_ukfedlabel.xsl"/>
<ref bean="check_ukreg"/>
<ref bean="check_uk_email"/>
<ref bean="check_owner"/>
<ref bean="check_uk_keydesc_key"/>
<ref bean="check_uk_mdattr"/>
Expand Down
14 changes: 0 additions & 14 deletions mdx/uk/check_ukreg.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:ukfedlabel="http://ukfederation.org.uk/2006/11/label"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:mdxMail="xalan://uk.ac.sdss.xalan.md.Mail"
extension-element-prefixes="mdxMail"

xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

<!--
Expand All @@ -25,16 +21,6 @@
<xsl:import href="../_rules/check_framework.xsl"/>


<!--
Check for badly formatted e-mail addresses.
-->
<xsl:template match="md:EmailAddress[mdxMail:dodgyAddress(.)]">
<xsl:call-template name="error">
<xsl:with-param name="m">badly formatted e-mail address: '<xsl:value-of select='.'/>'</xsl:with-param>
</xsl:call-template>
</xsl:template>


<!--
Check for https:// locations that use an explicit but redundant port specifier.
-->
Expand Down

0 comments on commit e8583f0

Please sign in to comment.