]> Pierre Choffet | Git repositories - banq_wikidata.git/commitdiff
Fix known error in source data
authorPierre Choffet <peuc@wanadoo.fr>
Fri, 27 Mar 2026 14:51:40 +0000 (10:51 -0400)
committerPierre Choffet <peuc@wanadoo.fr>
Fri, 27 Mar 2026 14:51:40 +0000 (10:51 -0400)
filter_marcxml.xslt

index 8c0c6bf21ede9d189f7273958da1424b45167916..457465ec7f636f15ada8f5444c7ca1b97fb58587 100644 (file)
@@ -25,6 +25,8 @@
                Remove the following authority entries:
                  - never referenced from any bibliographic record
                  - with no 100, 110 or 111 zones
+               
+               Also fixes some known errors in source records.
        -->
        
        
@@ -61,7 +63,9 @@
                
                <!-- Keep only authorities not referenced in any "no" filter -->
                <xsl:if test="$keep='yes'">
-                       <xsl:copy-of select="." />
+                       <xsl:copy>
+                               <xsl:apply-templates />
+                       </xsl:copy>
                </xsl:if>
        </xsl:template>
        
                        
                        <!-- Keep only authorities with at least one reference -->
                        <xsl:if test="$has-valid-reference='yes'">
-                               <xsl:copy-of select="." />
+                               <xsl:copy>
+                                       <xsl:apply-templates />
+                               </xsl:copy>
                        </xsl:if>
                </xsl:if>
        </xsl:template>
                </xsl:message>
        </xsl:template>
        
+       <!-- NOTE: In BAnQ data, there is a known error in data where full "Pablo" serie
+                  from "Michel Lancelot" has "Pablo Picasso" as contributor. Here,
+                  we’re removing this information -->
+       <xsl:template match="/marc:collection/marc:record[marc:datafield[@tag = '100']/marc:subfield[@code = 'a'] = 'Lancelot, Michel,']/marc:datafield[@tag = '700' and marc:subfield[@code = 'a'] = 'Picasso, Pablo,']" />
+       
        <!-- Return "no" if it contains any value to filter out record in 655$a, "yes" otherwise -->
        <xsl:template name="keep-655a">
                <xsl:variable name="filters">