Skip to content

Commit

Permalink
Remove deprecation, making it
Browse files Browse the repository at this point in the history
an outright error to have a contextless sch:assert or sch:report
  • Loading branch information
sydb committed Feb 11, 2025
1 parent cc26a63 commit abcc98b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions P5/Source/Specs/constraintSpec.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,8 @@
</sch:rule>
</constraint>
</constraintSpec>
<constraintSpec ident="context-required" scheme="schematron" type="deprecationWarning" validUntil="2025-04-15" xml:lang="en">
<desc type="deprecationInfo" versionDate="2024-03-15" xml:lang="en">
The use of ISO Schematron <gi>sch:assert</gi> and
<gi>sch:report</gi> elements without a parent <gi>sch:rule</gi>
with a <att>context</att> attribute is deprecated — it will be
an error after 2025-03-15.</desc>
<!-- It is somewhat easier and clearer to use
<constraintSpec ident="context-required" scheme="schematron" xml:lang="en">
<!-- It would be somewhat easier and clearer to use
"tei:constraintSpec[ @scheme eq 'schematron']//( sch:assert | sch:report )"
as the context and then test for "ancestor::sch:rule/@context".
But if we did that, then a user who had multiple
Expand All @@ -80,7 +75,8 @@
<sch:rule context="tei:constraintSpec[ @scheme eq 'schematron']/tei:constraint[ .//sch:assert | .//sch:report ]">
<sch:let name="assertsHaveContext" value="for $a in .//sch:assert return exists( $a/ancestor::sch:rule/@context )"/>
<sch:let name="reportsHaveContext" value="for $r in .//sch:report return exists( $r/ancestor::sch:rule/@context )"/>
<sch:report test="( $assertsHaveContext, $reportsHaveContext ) = false()" role="warning">The use of an &lt;sch:assert&gt; or &lt;sch:report&gt; that does not have a context (i.e., does not have an ancestor &lt;sch:rule&gt; with a @context attribute) in an ISO Schematron constraint specification is deprecated, and will become invalid after 2025-03-15.</sch:report>
<sch:report test="( $assertsHaveContext, $reportsHaveContext )
= false()" role="warning">An &lt;sch:assert&gt; or &lt;sch:report&gt; element must be a descendant of an &lt;sch:rule&gt; that has a @context.</sch:report>
</sch:rule>
</constraint>
</constraintSpec>
Expand Down
2 changes: 1 addition & 1 deletion P5/Test/expected-results/detest_odd_schematron.log
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ validateodd:
[xslt] Rules in the ISO Schematron language must be inside a constraintSpec with the value 'schematron' on the scheme attribute (tei:constraint/sch:* and not( @scheme eq 'schematron'))
[xslt] Rules in the ISO Schematron language must be inside a constraintSpec with the value 'schematron' on the scheme attribute (tei:constraint/sch:* and not( @scheme eq 'schematron'))
[xslt] Rules in the ISO Schematron language must be inside a constraintSpec with the value 'schematron' on the scheme attribute (tei:constraint/sch:* and not( @scheme eq 'schematron'))
[xslt] The use of an &lt;sch:assert&gt; or &lt;sch:report&gt; that does not have a context (i.e., does not have an ancestor &lt;sch:rule&gt; with a @context attribute) in an ISO Schematron constraint specification is deprecated, and will become invalid after 2025-03-15. (( $assertsHaveContext, $reportsHaveContext ) = false() / warning)
[xslt] An &lt;sch:assert&gt; or &lt;sch:report&gt; element must be a descendant of an &lt;sch:rule&gt; that has a @context. (( $assertsHaveContext, $reportsHaveContext ) = false() / warning)
[xslt] The @scheme attribute of &lt;constraintSpec&gt; is required when the @mode is not specified (here on "add_missing_scheme") (@scheme)
[xslt] The @scheme attribute of &lt;constraintSpec&gt; is required when the @mode is "replace" (here on "replace_missing_scheme") (@scheme)
[xslt] The @scheme attribute of &lt;constraintSpec&gt; is required when the @mode is not specified (here on "add_missing_scheme") (@scheme)
Expand Down

0 comments on commit abcc98b

Please sign in to comment.