Skip to content

Commit

Permalink
schematrons: Remove all rules that fetch another notice (TEDEFO-3376)
Browse files Browse the repository at this point in the history
They have currently no effect, as the service they call does not exist,
and they are also incomplete.
They cause errors with ph-schematron 8.0.0 in pure mode, so it's better
to remove them.

(cherry picked from commit e9d516d)
  • Loading branch information
bertrand-lorentz committed Jul 12, 2024
1 parent 6717840 commit 75eb366
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 40 deletions.
3 changes: 2 additions & 1 deletion schematrons/dynamic/config.sch
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- URL prefix of the service to fetch a notice.
The value must be between single quotes.
The notice identifier will be appended, to build the URL used to fetch the corresponding notice XML. -->
The notice identifier will be appended, to build the URL used to fetch the corresponding notice XML.
Currently not used. -->
<let xmlns="http://purl.oclc.org/dsdl/schematron" name="urlPrefix" value="'http://localhost:8080/notices/'"/>
3 changes: 0 additions & 3 deletions schematrons/dynamic/validation-stage-6a.sch
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--File generated from metadata database version 1.7.0 created on the 2023-03-31T15:30.-->
<pattern id="EFORMS-validation-stage-6a" xmlns="http://purl.oclc.org/dsdl/schematron">
<rule context="/*/cac:ProcurementProject/cac:MainCommodityClassification[/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Changes/efbc:ChangedNoticeIdentifier]">
<assert id="BR-BT-00262-0300" role="ERROR" diagnostics="BT-262-Procedure" test="(cbc:ItemClassificationCode/normalize-space(text()) = fn:doc(concat($urlPrefix, /*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Changes/efbc:ChangedNoticeIdentifier/normalize-space(text())))/*/cac:ProcurementProject/cac:MainCommodityClassification/cbc:ItemClassificationCode/normalize-space(text())) or not(fn:doc(concat($urlPrefix, /*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Changes/efbc:ChangedNoticeIdentifier/normalize-space(text())))/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:NoticeSubType/cbc:SubTypeCode/normalize-space(text()) = ('10','11','CEI','12','13','14','15','16','17','18','19','E3','20','21','22','23','24','25','26','27','28','29','30','31','32','E4','T02','33','34','35','36','37','38','39','40','E5') and (fn:doc(concat($urlPrefix, /*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Changes/efbc:ChangedNoticeIdentifier/normalize-space(text())))/*/cac:ProcurementProject/cac:MainCommodityClassification/cbc:ItemClassificationCode))">rule|text|BR-BT-00262-0300</assert>
</rule>
</pattern>
36 changes: 0 additions & 36 deletions schematrons/dynamic/validation-stage-6b.sch
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,4 @@
</assert>
</rule>

<!-- Schematron rules to enforce that certain values in a Change Notice are the
same as those in the parent notice (the notice that is subject to the change). -->

<!-- Reference to the parent notice. -->
<let name="parentNoticeId" value="/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Changes/efbc:ChangedNoticeIdentifier/fn:normalize-space(text())"/>

<!-- Function that fetches a notice based on its identifier.
The value of $urlPrefix is defined in config.sch. -->
<let name="getParentNotice" value="function($id) { fn:doc(concat($urlPrefix, $id)) }"/>

<!-- XML document of the parent notice. -->
<let name="parentNotice" value="$getParentNotice($parentNoticeId)"/>

<!-- Rules applying at root or Procedure level -->
<rule context="/*[$isChangeNotice = true()]">
<!-- Notice subtype -->
<assert role="ERROR" test="$noticeSubType eq $parentNotice/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:NoticeSubType/cbc:SubTypeCode/fn:normalize-space(text())">
The notice subtype must be the same as for the parent notice.
</assert>

<!-- BT-105-Procedure Procedure Type -->
<assert role="ERROR" test="deep-equal( cac:TenderingProcess/cbc:ProcedureCode/fn:normalize-space(text()), $parentNotice/*/cac:TenderingProcess/cbc:ProcedureCode/fn:normalize-space(text()) )">
The value of "Procedure Type" (BT-105-Procedure) value must be the same as for the parent notice.
</assert>

<!-- BT-04-notice Procedure Identifier -->
<assert role="ERROR" test="cbc:ContractFolderID/fn:normalize-space(text()) = $parentNotice/*/cbc:ContractFolderID/fn:normalize-space(text())">
The value of "Procedure Identifier" (BT-04-notice) must be the same as for the parent notice.
</assert>

<!-- BT-23-Procedure Main Nature -->
<assert role="ERROR" test="( cac:ProcurementProject/cbc:ProcurementTypeCode[@listName='contract-nature']/fn:normalize-space(text()) = $parentNotice/*/cac:ProcurementProject/cbc:ProcurementTypeCode[@listName='contract-nature']/fn:normalize-space(text()) )">
The value of "Main Nature" (BT-23-Procedure) must be the same as for the parent notice.
</assert>
</rule>

</pattern>

0 comments on commit 75eb366

Please sign in to comment.