Skip to content

Commit

Permalink
#5 EBA Filing Rules
Browse files Browse the repository at this point in the history
  • Loading branch information
John Nordberg committed Apr 25, 2024
1 parent 6982a4f commit f40ffe6
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 2 deletions.
52 changes: 52 additions & 0 deletions eba.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,26 @@
</xsl:call-template>
</xsl:if>

<xsl:variable name="instants" select="xbrli:context/xbrli:period/xbrli:instant" />
<xsl:variable name="distinct_instants"
select="$instants[not(text()=preceding::xbrli:instant/text())]" />
<xsl:if test="count($distinct_instants) &gt; 1">
<xsl:call-template name="EBAError">
<xsl:with-param name="code" select="'2.13.a'" />
<xsl:with-param name="context" select="$distinct_instants" />
</xsl:call-template>
</xsl:if>

<xsl:variable name="noninstants"
select="xbrli:context/xbrli:period/*[name()!='xbrli:instant']" />
<xsl:if test="noninstants">
<xsl:call-template name="EBAError">
<xsl:with-param name="code" select="'2.13.b'" />
<xsl:with-param name="context" select="$noninstants" />
</xsl:call-template>
</xsl:if>
<!-- /root/*[not(name()='terminate')] -->

<xsl:apply-templates />

</xsl:template>
Expand Down Expand Up @@ -271,12 +291,44 @@
<xsl:with-param name="context" select="exsl:node-set($cid)|$matching/@id" />
</xsl:call-template>
</xsl:if>

<xsl:apply-templates />
</xsl:template>

<!-- 2.8.a requires lookup etc -->
<!-- 2.8.b requires lookup etc -->
<!-- 2.8.c requires lookup etc -->

<xsl:template match="/xbrli:xbrl/xbrli:context/xbrli:period/xbrli:instant">
<xsl:if test="contains(text(),'T')">
<xsl:call-template name="EBAError">
<xsl:with-param name="code" select="'2.10.a'" />
<xsl:with-param name="context" select="." />
</xsl:call-template>
</xsl:if>
<xsl:if
test="contains(substring-after(text(),'T'), '+') or contains(substring-after(text(),'T'), '-') or contains(substring-after(text(),'T'), 'Z')">
<xsl:call-template name="EBAError">
<xsl:with-param name="code" select="'2.10.b'" />
<xsl:with-param name="context" select="." />
</xsl:call-template>
</xsl:if>

</xsl:template>

<xsl:template match="xbrli:forever">
<xsl:call-template name="EBAError">
<xsl:with-param name="code" select="'2.11'" />
<xsl:with-param name="context" select="." />
</xsl:call-template>
</xsl:template>

<xsl:template match="xbrli:segment">
<xsl:call-template name="EBAError">
<xsl:with-param name="code" select="'2.14'" />
<xsl:with-param name="context" select="." />
</xsl:call-template>
</xsl:template>

<xsl:template match="text()|@*">
<!-- <xsl:value-of select="."/> -->
Expand Down
39 changes: 37 additions & 2 deletions lookup/eba-validations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,43 @@
<rule>
<error_code>2.9</error_code>
<error_message>multipleIdentifiers</error_message>
<severity>WARNING</severity>
<severity>ERROR</severity>
<control>All xbrli:identifier content and @scheme attributes in an report MUST be identical. [EFM13, p. 6-8]</control>
</rule>

<rule>
<error_code>2.10.a</error_code>
<error_message>periodWithTimeContent</error_message>
<severity>ERROR</severity>
<control>All xbrli:period date elements MUST be valid against the xs:date data type, and reported without a timezone. [GFM11, p. 16]</control>
</rule>
<rule>
<error_code>2.10.b</error_code>
<error_message>periodWithTimezone</error_message>
<severity>ERROR</severity>
<control>All xbrli:period date elements MUST be valid against the xs:date data type, and reported without a timezone. [GFM11, p. 16]</control>
</rule>
<rule>
<error_code>2.11</error_code>
<error_message>foreverUsed</error_message>
<severity>ERROR</severity>
<control>The element 'xbrli:forever' MUST NOT be used. [GFM11, p. 19]</control>
</rule>
<rule>
<error_code>2.13.a</error_code>
<error_message>multiplePeriodsUsed</error_message>
<severity>ERROR</severity>
<control>All xbrl periods in a XBRL report MUST refer to the (same) reference date instant.</control>
</rule>
<rule>
<error_code>2.13.b</error_code>
<error_message>nonInstantPeriodUsed</error_message>
<severity>ERROR</severity>
<control>All xbrl periods MUST be instants.</control>
</rule>
<rule>
<error_code>2.14</error_code>
<error_message>segmentUsed</error_message>
<severity>ERROR</severity>
<control>xbrli:segment elements MUST NOT be used.</control>
</rule>
</validation_rules>

0 comments on commit f40ffe6

Please sign in to comment.