]> Lady’s Gitweb - Shushe/blobdiff - lib/catalog2transform.xslt
Move includes above result variables
[Shushe] / lib / catalog2transform.xslt
index b93aa371190c9eedb7502f90c628bf609eb8329a..b2cd23601ef34cd12deadcc3d5dadda2de718c90 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/>.
@@ -86,6 +86,13 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                </apply-templates>
                        </xslt:variable>
                        <xslt:variable name="书社:about" select="exsl:node-set($书社:about-fragment)"/>
+                       <for-each select="//catalog:uri">
+                               <xslt:include href="{@uri}">
+                                       <attribute name="书社:id">
+                                               <value-of select="@name"/>
+                                       </attribute>
+                               </xslt:include>
+                       </for-each>
                        <xslt:variable name="书社:expansion-fragment">
                                <xslt:apply-templates select="$书社:source/node()" mode="书社:expand"/>
                        </xslt:variable>
@@ -100,13 +107,6 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                        </xslt:variable>
                        <xslt:variable name="书社:result" select="书社:document-with-attributes-applied(exsl:node-set($书社:result-fragment))"/>
                        <xslt:variable name="书社:destination" select="string($书社:about//*[@rdf:about=$IDENTIFIER]/@书社vocab:destination)"/>
-                       <for-each select="//catalog:uri">
-                               <xslt:include href="{@uri}">
-                                       <attribute name="书社:id">
-                                               <value-of select="@name"/>
-                                       </attribute>
-                               </xslt:include>
-                       </for-each>
                        <xslt:template name="书社:apply-attributes">
                                <xslt:param name="context-nodes" select="/.."/>
                                <xslt:param name="destination-nodes" select="/.."/>
@@ -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.291244 seconds and 4 git commands to generate.