Skip to content

fix(rng export): remove rng:data if element have fixed_value

Noé Gaumont requested to merge topic/seda21/cutodial-history-item into branch/seda21

Before this patch, the test was done on the last child. After this patch, there is a search on all children.

This is needed for CustodialHistoryItem

Fix #15 (closed)

On local machine, the export of this seda profile ouputs the following local export. This is has to be compared to the one listed in the issue. Here is the diff:

--- "remote.rng"	2021-07-07 16:03:43.917185220 +0200
+++ "locale.rng"	2021-07-07 16:05:40.502647324 +0200
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='utf-8' standalone='no'?>
-<rng:grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:seda="fr:gouv:culture:archivesdefrance:seda:v2.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="fr:gouv:culture:archivesdefrance:seda:v2.1" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" ns="fr:gouv:culture:archivesdefrance:seda:v2.1" seda:warnings="">
+<rng:grammar xmlns="fr:gouv:culture:archivesdefrance:seda:v2.1" xmlns:seda="fr:gouv:culture:archivesdefrance:seda:v2.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" ns="fr:gouv:culture:archivesdefrance:seda:v2.1" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" seda:warnings="">
   <rng:start>
     <rng:element name="ArchiveTransfer">
       <rng:zeroOrMore>
@@ -448,7 +448,6 @@
                   <rng:optional>
                     <rng:element name="CustodialHistory">
                       <rng:element name="CustodialHistoryItem">
-                        <rng:data type="string"/>
                         <rng:choice>
                           <rng:attribute name="when">
                             <rng:data type="date"/>
@@ -472,7 +471,7 @@
                             <rng:data type="gYearMonth"/>
                           </rng:attribute>
                         </rng:choice>
-                        <rng:value>Ces enregistrements sont transférés à l'initiative du service de l'assemblée directement vers le SAE internalisé pour conservation patrimoniale.</rng:value>
+                        <rng:value type="string">Ces enregistrements sont transférés à l'initiative du service de l'assemblée directement vers le SAE internalisé pour conservation patrimoniale.</rng:value>
                       </rng:element>
                     </rng:element>
                   </rng:optional>

Ping @bnichele, could you verify the new output ?

--HG-- branch : seda21

Merge request reports

Loading