]> Lady’s Gitweb - Shushe/blobdiff - lib/catalog2transform.xslt
Do not wrap results which contain no H·T·M·L
[Shushe] / lib / catalog2transform.xslt
index d49ad113057e0df00950c449f778bd9c528afb05..74f7f46b4edf3fdc5f78502664f7584ae58b9941 100644 (file)
@@ -6,7 +6,7 @@ SPDX-License-Identifier: MPL-2.0
 <!--
 ⁌ ⛩📰 书社 ∷ lib/catalog2transform.xslt
 
-© 2023–2024 Lady [@ Ladys Computer].
+© 2023–2024 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/>.
@@ -44,7 +44,9 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                        <xslt:param name="THISREV" select="false()"/>
                        <xslt:variable name="书社:source" select="/"/>
                        <xslt:variable name="书社:about-fragment">
-                               <apply-templates select="document($METADATA)" mode="书社:literally"/>
+                               <apply-templates select="document($METADATA)" mode="书社:literally">
+                                       <with-param name="extension-element-namespaces" select="'http://exslt.org/common http://exslt.org/strings'"/>
+                               </apply-templates>
                        </xslt:variable>
                        <xslt:variable name="书社:about" select="exsl:node-set($书社:about-fragment)"/>
                        <xslt:variable name="书社:expansion-fragment">
@@ -263,7 +265,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                <xslt:variable name="result-nodes" select="$书社:result/node()[not(self::书社:apply-attributes-to-root)]|$书社: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/self::书社:*[local-name()='raw-text' or local-name()='base64-binary' or local-name()='archive']|$result-nodes/@书社:disable-output-wrapping|$书社:result//书社:apply-attributes-to-root/@书社:disable-output-wrapping">
+                                               <xslt:when test="not($result-nodes/self::html:*) or $result-nodes/self::书社:*[local-name()='raw-text' or local-name()='base64-binary' or local-name()='archive'] or $result-nodes/@书社:disable-output-wrapping or $书社: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="context-nodes" select="$书社:result//书社:apply-attributes-to-root"/>
This page took 0.090383 seconds and 4 git commands to generate.