Skip to content

Commit

Permalink
Check for empty xs:string elements in MDUI. The standard also forbids…
Browse files Browse the repository at this point in the history
… xs:string elements which contain only whitespace, but that is a very hard to do in XSLT so these checks should be redone in Java at some point.
  • Loading branch information
iay committed Feb 17, 2012
1 parent a836306 commit 7453da5
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions build/check_mdui.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,42 @@
-->
<xsl:import href="check_framework.xsl"/>

<!--
General SAML constraint that xs:string elements must contain at least one
non-whitespace character. That's actually too hard to do in XSLT so we'll
restrict ourselves to a check for empty elements for now.
-->
<xsl:template match="mdui:DisplayName[. = '']">
<xsl:call-template name="error">
<xsl:with-param name="m">mdui:DisplayName must not be empty</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="mdui:Description[. = '']">
<xsl:call-template name="error">
<xsl:with-param name="m">mdui:Description must not be empty</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="mdui:Keywords[. = '']">
<xsl:call-template name="error">
<xsl:with-param name="m">mdui:Keywords must not be empty</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="mdui:IPHint[. = '']">
<xsl:call-template name="error">
<xsl:with-param name="m">mdui:IPHint must not be empty</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="mdui:DomainHint[. = '']">
<xsl:call-template name="error">
<xsl:with-param name="m">mdui:DomainHint must not be empty</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="mdui:GeolocationHint[. = '']">
<xsl:call-template name="error">
<xsl:with-param name="m">mdui:GeolocationHint must not be empty</xsl:with-param>
</xsl:call-template>
</xsl:template>

<!--
Section 2.1
Expand Down

0 comments on commit 7453da5

Please sign in to comment.