]> Lady’s Gitweb - Shushe/commitdiff
Reduce @书社:archived-as noise 1.0.0
authorLady <redacted>
Sat, 25 Jan 2025 03:00:06 +0000 (22:00 -0500)
committerLady <redacted>
Sat, 25 Jan 2025 03:00:06 +0000 (22:00 -0500)
This commit causes `@书社:archived-as` to be dropped in the following
cases :—

- In the components of archives, during extraction.
- In wrapped nodes, where it is raised to the wrapping `<html:html>`
  element.

It also makes `lib/archive2extractor.xslt` a prerequisite for the
finalization step and `lib/catalog2transform.xslt` a prerequisite for
results, to ensure that files are appropriately updated when these
change.

GNUmakefile
lib/archive2extractor.xslt
lib/catalog2transform.xslt

index c1b34fc7821285246f689478ff2c29fff8d6bf7b..ca6bfcdb64401def581d782d93418874d92795c5 100644 (file)
@@ -649,13 +649,13 @@ $(BUILDDIR)/transform.xslt : $(BUILDDIR)/transform.catalog $(BUILDDIR)/metadata
 # • When the metadata of ⹐source files they depend on⹑ change.
 #
 # This is to reduce the number of needless regenerations of files with no substantial change.
-$(call compiled,$(compilablefiles)) : $(BUILDDIR)/results/% : $$(call parsed,$$(call uncompiled,$$@)) $$(call parsed,$$(call dependencies,$$(call uncompiled,$$@))) $(BUILDDIR)/transform.catalog $(TRANSFORMLIBS) $$(call metadata,$$(call dependencies,$$(call uncompiled,$$@)))
+$(call compiled,$(compilablefiles)) : $(BUILDDIR)/results/% : $$(call parsed,$$(call uncompiled,$$@)) $$(call parsed,$$(call dependencies,$$(call uncompiled,$$@))) $(BUILDDIR)/transform.catalog $(THISDIR)/lib/catalog2transform.xslt $(TRANSFORMLIBS) $$(call metadata,$$(call dependencies,$$(call uncompiled,$$@)))
        $(call inform,$(PRINTF) '%s\n' $(call quote,Compiling </$*>…) >&2)
        $(silent)$(call ensuredirectory,$(dir $@))
        $(silent)$(XSLTPROC) --nonet --novalid --nomkdir --nowrite --stringparam METADATA 'metadata' --stringparam BUILDTIME $$($(DATE) -u '+%Y-%m-%dT%H:%M:%SZ') --stringparam IDENTIFIER $(call quote,$(call localuri,$(call uncompiled,$@)))$(if $(THISREV), --stringparam THISREV $(call quote,$(THISREV)),)$(if $(SRCREV), --stringparam SRCREV $(call quote,$(SRCREV)),) $(call quote,$(BUILDDIR)/transform.xslt) $(call quote,$<) >|$(call quote,$@)
 
 # Create the final files from the compiled results (or error in the case of recursive ones).
-$(call built,$(compilablefiles)) : $(BUILDDIR)/public/% : $(BUILDDIR)/results/%
+$(call built,$(compilablefiles)) : $(BUILDDIR)/public/% : $(BUILDDIR)/results/% $(THISDIR)/lib/archive2extractor.xslt
        $(call inform,$(PRINTF) '%s\n' $(call quote,Building </$*>…) >&2)
        $(silent)$(call ensuredirectory,$(dir $@))
        $(silent)$(RM) -f -R $(call quote,$@)
index b07b734046fe3d5d6425a7ceea5df36e0195b0f6..f9c8bdf4bf688596bec0d02d1d1a0dc731f125b7 100644 (file)
@@ -1,12 +1,12 @@
 <?xml version="1.0"?>
 <!--
-SPDX-FileCopyrightText: 2024 Lady <https://www.ladys.computer/about/#lady>
+SPDX-FileCopyrightText: 2024, 2025 Lady <https://www.ladys.computer/about/#lady>
 SPDX-License-Identifier: MPL-2.0
 -->
 <!--
 ⁌ ⛩📰 书社 ∷ lib/archive2extractor.xslt
 
-© 2024 Lady [@ Ladys Computer].
+© 2024–2025 Lady [@ Ladys Computer].
 
 This Source Code Form is subject to the terms of the Mozilla Public License, v 2.0.
 If a copy of the M·P·L was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
@@ -38,7 +38,11 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                                <xslt:variable name="href">
                                                        <value-of select="@书社:archived-as"/>
                                                </xslt:variable>
-                                               <xslt:copy-of select="书社:archive/*[@书社:archived-as=$href][1]"/>
+                                               <xslt:for-each select="书社:archive/*[@书社:archived-as=$href][1]">
+                                                       <xslt:copy>
+                                                               <xslt:copy-of select="@*[not(namespace-uri()='urn:fdc:ladys.computer:20231231:Shu1She4' and local-name()='archived-as')]|node()"/>
+                                                       </xslt:copy>
+                                               </xslt:for-each>
                                        </exsl:document>
                                        <xslt:text>
                                                <value-of select="$href"/>
index b93aa371190c9eedb7502f90c628bf609eb8329a..ce94067fa445d9b88b3fd63ba1f37836d62c40e4 100644 (file)
@@ -1,12 +1,12 @@
 <?xml version="1.0"?>
 <!--
-SPDX-FileCopyrightText: 2023, 2024 Lady <https://www.ladys.computer/about/#lady>
+SPDX-FileCopyrightText: 2023, 2024, 2025 Lady <https://www.ladys.computer/about/#lady>
 SPDX-License-Identifier: MPL-2.0
 -->
 <!--
 ⁌ ⛩📰 书社 ∷ lib/catalog2transform.xslt
 
-© 2023–2024 Lady [@ Ladys Computer].
+© 2023–2025 Lady [@ Ladys Computer].
 
 This Source Code Form is subject to the terms of the Mozilla Public License, v 2.0.
 If a copy of the M·P·L was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
@@ -280,9 +280,13 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                                </xslt:element>
                                        </xslt:element>
                                        <xslt:element name="body" namespace="&xhtml;">
-                                               <xslt:copy-of select="$nodes[self::html:html]/html:body/@*|$nodes[self::html:body]/@*"/>
+                                               <xslt:copy-of select="($nodes[self::html:html]/html:body/@*|$nodes[self::html:body]/@*)[not(namespace-uri()='&书社;' and local-name()='archived-as')]"/>
                                                <xslt:apply-templates select="$modalinput/node()" mode="书社:header"/>
-                                               <xslt:copy-of select="$nodes[not(self::html:html or self::html:head or self::html:body)]|$nodes[self::html:html]/node()[not(self::html:head or self::html:body)]|$nodes[self::html:html]/html:body/node()|$nodes[self::html:body]/node()"/>
+                                               <xslt:for-each select="$nodes[not(self::html:html or self::html:head or self::html:body)]|$nodes[self::html:html]/node()[not(self::html:head or self::html:body)]|$nodes[self::html:html]/html:body/node()|$nodes[self::html:body]/node()">
+                                                       <xslt:copy>
+                                                               <xslt:copy-of select="@*[not(namespace-uri()='&书社;' and local-name()='archived-as')]|node()"/>
+                                                       </xslt:copy>
+                                               </xslt:for-each>
                                                <xslt:apply-templates select="$modalinput/node()" mode="书社:footer"/>
                                        </xslt:element>
                                </xslt:element>
This page took 0.036109 seconds and 4 git commands to generate.