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

Commit

Permalink
Extend valid URL checking to all appropruate MDUI elements.
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed Aug 13, 2014
1 parent adcd584 commit d961533
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions mdx/_rules/check_mdui.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,57 @@
</xsl:if>
</xsl:template>

<!--
Check for <mdui:Logo> elements that aren't valid URLs.
Again, explicitly permit anything starting with 'data:'.
-->
<xsl:template match="mdui:Logo[mdxURL:invalidURL(.)]">
<xsl:if test="not(starts-with(., 'data:'))">
<xsl:call-template name="error">
<xsl:with-param name="m">
<xsl:text>mdui:</xsl:text>
<xsl:value-of select='local-name()'/>
<xsl:text> '</xsl:text>
<xsl:value-of select="."/>
<xsl:text>' is not a valid URL: </xsl:text>
<xsl:value-of select="mdxURL:whyInvalid(.)"/>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>

<!--
Section 2.1.6 Element <mdui:InformationURL>
Require that the URL is valid.
-->
<xsl:template match="md:InformationURL[mdxURL:invalidURL(.)]">
<xsl:template match="mdui:InformationURL[mdxURL:invalidURL(.)]">
<xsl:call-template name="error">
<xsl:with-param name="m">
<xsl:text>mdui:</xsl:text>
<xsl:value-of select='local-name()'/>
<xsl:text> '</xsl:text>
<xsl:value-of select="."/>
<xsl:text>' is not a valid URL: </xsl:text>
<xsl:value-of select="mdxURL:whyInvalid(.)"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>

<!--
Section 2.1.7 Element <mdui:PrivacyStatementURL>
Require that the URL is valid.
-->
<xsl:template match="mdui:PrivacyStatementURL[mdxURL:invalidURL(.)]">
<xsl:call-template name="error">
<xsl:with-param name="m">
<xsl:text>mdui:</xsl:text>
<xsl:value-of select='local-name()'/>
<xsl:text> is not a valid URL: </xsl:text>
<xsl:text> '</xsl:text>
<xsl:value-of select="."/>
<xsl:text>' is not a valid URL: </xsl:text>
<xsl:value-of select="mdxURL:whyInvalid(.)"/>
</xsl:with-param>
</xsl:call-template>
Expand Down

0 comments on commit d961533

Please sign in to comment.