]> Lady’s Gitweb - Shushe/blobdiff - lib/catalog2transform.xslt
Allow ⛩️📰 书社 to produce plain text
[Shushe] / lib / catalog2transform.xslt
index b53e12ab9f29bed8f2bc8ae827e38377eecb9452..85d043c7c359651f0a855e751ac9cc20efd49267 100644 (file)
@@ -1,8 +1,12 @@
 <?xml version="1.0"?>
 <!--
+SPDX-FileCopyrightText: 2023, 2024 Lady <https://www.ladys.computer/about/#lady>
+SPDX-License-Identifier: MPL-2.0
+-->
+<!--
 ⁌ ⛩️📰 书社 ∷ lib/catalog2transform.xslt
 
-© 2023–2024 Lady [@ Lady’s Computer]
+© 2023–2024 Lady [@ Lady’s 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/>.
@@ -27,13 +31,13 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
        <template match="/">
                <xslt:transform exclude-result-prefixes="catalog exsl exslstr" version="1.0">
                        <xslt:param name="BUILDTIME" select="'1972-12-31T00:00:00Z'"/>
-                       <xslt:param name="CKSUM" select="false"/>
+                       <xslt:param name="CKSUM" select="false()"/>
                        <xslt:param name="CATALOG" select="'catalog'"/>
-                       <xslt:param name="IDENTIFIER" select="false"/>
+                       <xslt:param name="IDENTIFIER" select="false()"/>
                        <xslt:param name="PATH" select="'/unknown'"/>
-                       <xslt:param name="SRCREV" select="false"/>
+                       <xslt:param name="SRCREV" select="false()"/>
                        <xslt:param name="SRCTIME" select="'1972-12-31T00:00:00Z'"/>
-                       <xslt:param name="THISREV" select="false"/>
+                       <xslt:param name="THISREV" select="false()"/>
                        <xslt:variable name="书社:source" select="/"/>
                        <xslt:variable name="书社:expansion">
                                <xslt:apply-templates select="$书社:source/node()" mode="书社:expand"/>
@@ -51,7 +55,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                </xslt:include>
                        </for-each>
                        <xslt:template name="书社:apply-attributes">
-                               <xslt:param name="and-version" select="false"/>
+                               <xslt:param name="and-version" select="false()"/>
                                <xslt:param name="context-nodes" select="/.."/>
                                <xslt:param name="destination-nodes" select="/.."/>
                                <xslt:variable name="additional-attributes" select="$context-nodes/@*"/>
@@ -228,9 +232,9 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                <xslt:variable name="result-nodes" select="exsl:node-set($书社:result)/node()[not(self::书社:apply-attributes-to-root)]|exsl:node-set($书社:result)/书社:apply-attributes-to-root/descendant::node()[not(self::书社:apply-attributes-to-root) and not(ancestor::*[not(self::书社:apply-attributes-to-root)])]"/>
                                <xslt:variable name="root-with-attributes">
                                        <xslt:choose>
-                                               <xslt:when test="$result-nodes/@书社:disable-output-wrapping|exsl:node-set($书社:result)//书社:apply-attributes-to-root/@书社:disable-output-wrapping">
+                                               <xslt:when test="$result-nodes/self::书社:*[local-name()='raw-text' or local-name()='base64-binary']|$result-nodes/@书社:disable-output-wrapping|exsl:node-set($书社:result)//书社:apply-attributes-to-root/@书社:disable-output-wrapping">
                                                        <xslt:call-template name="书社:apply-attributes">
-                                                               <xslt:with-param name="and-version" select="true"/>
+                                                               <xslt:with-param name="and-version" select="true()"/>
                                                                <xslt:with-param name="context-nodes" select="exsl:node-set($书社:result)//书社:apply-attributes-to-root"/>
                                                                <xslt:with-param name="destination-nodes" select="$result-nodes"/>
                                                        </xslt:call-template>
@@ -242,7 +246,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                                                </xslt:call-template>
                                                        </xslt:variable>
                                                        <xslt:call-template name="书社:apply-attributes">
-                                                               <xslt:with-param name="and-version" select="true"/>
+                                                               <xslt:with-param name="and-version" select="true()"/>
                                                                <xslt:with-param name="context-nodes" select="exsl:node-set($书社:result)//书社:apply-attributes-to-root"/>
                                                                <xslt:with-param name="destination-nodes" select="exsl:node-set($wrapped-result)/node()"/>
                                                        </xslt:call-template>
This page took 0.026267 seconds and 4 git commands to generate.