Skip to content

Commit

Permalink
Migrate check for Location attributes containing space characters.
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed May 11, 2009
1 parent 32328f5 commit 5cbec31
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
13 changes: 13 additions & 0 deletions build/check.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@
</xsl:template>


<!--
@Location attributes should not contain space characters.
This may be a little strict, and might be better confined to md:* elements.
At present, however, this produces no false positives.
-->
<xsl:template match="*[contains(@Location, ' ')]">
<xsl:call-template name="fatal">
<xsl:with-param name="m"><xsl:value-of select='local-name()'/> Location contains space character</xsl:with-param>
</xsl:call-template>
</xsl:template>


<!--
Common template to call to report a fatal error on some element within an entity.
-->
Expand Down
23 changes: 6 additions & 17 deletions build/statistics.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@
Look for some potential problems in the metadata. We need to do this
at the start so that we can include or exclude the associated section.
-->
<!-- spaces in Locations -->
<xsl:variable name="prob.space.location" select="$entities[descendant::*[contains(@Location,' ')]]"/>

<!-- Locations that don't start with https:// -->
<xsl:variable name="prob.nohttps.location.exceptions"
Expand Down Expand Up @@ -126,9 +124,12 @@
[@Binding!='urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol']]"/>

<!-- all problems, used as a conditional -->
<xsl:variable name="prob.all" select="$prob.space.location |
$prob.nohttps.location | $prob.discovery.binding.missing | $prob.discovery.binding.wrong |
$prob.dup.entityID | $prob.dup.ODNs | $prob.unowned.entities"/>
<xsl:variable name="prob.all" select="$prob.nohttps.location |
$prob.discovery.binding.missing |
$prob.discovery.binding.wrong |
$prob.dup.entityID |
$prob.dup.ODNs |
$prob.unowned.entities"/>
<xsl:variable name="prob.count" select="count($prob.all)"/>

<html>
Expand Down Expand Up @@ -159,18 +160,6 @@
-->
<xsl:if test="$prob.count != 0">
<h2><a name="problems">Metadata Problems</a></h2>
<xsl:if test="count($prob.space.location) != 0">
<p>The following entities include elements with <code>Location</code> attributes
that include space characters:</p>
<ul>
<xsl:for-each select="$prob.space.location">
<li>
<xsl:value-of select="@ID"/>:
<code><xsl:value-of select="@entityID"/></code>
</li>
</xsl:for-each>
</ul>
</xsl:if>
<xsl:if test="count($prob.nohttps.location) != 0">
<p>The following entities include elements with <code>Location</code> attributes
that don't start with <code>https://</code>:</p>
Expand Down

0 comments on commit 5cbec31

Please sign in to comment.