]> Lady’s Gitweb - Shushe/blobdiff - transforms/metadata.xslt
Allow output wrapping to be disabled
[Shushe] / transforms / metadata.xslt
index d4be49327dc6013e32413878d9fb0e9159c3d8aa..b5f180fef3391af1d00a2947afa524856229a9af 100644 (file)
@@ -2,11 +2,15 @@
 <!--
 ⁌ ⛩️📰 书社 ∷ transforms/metadata.xslt
 
-© 2023 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/>.
 -->
+<!DOCTYPE transform [
+       <!ENTITY attoplevel "ancestor::html:*[@itemscope and @itemtype='&书社;:document'] and not(ancestor::html:*[@itemscope]/ancestor::html:*[@itemscope and @itemtype='&书社;:document'] or preceding::html:*[@itemtype='&书社;:document'])">
+       <!ENTITY 书社 "urn:fdc:ladys.computer:20231231:Shu1She4">
+]>
 <transform
        xmlns="http://www.w3.org/1999/XSL/Transform"
        xmlns:html="http://www.w3.org/1999/xhtml"
@@ -14,23 +18,10 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
        exclude-result-prefixes="书社"
        version="1.0"
 >
-       <template match="html:*[@itemscope][1]//html:meta[not(@name) and starts-with(@itemprop, 'urn:fdc:ladys.computer:20231231:Shu1She4:')]">
-               <comment>
-                       <text>[书社:META] </text>
-                       <value-of select="substring-after(@itemprop, 'urn:fdc:ladys.computer:20231231:Shu1She4:')"/>
-                       <text>: </text>
+       <书社:id>urn:fdc:ladys.computer:20231231:Shu1She4:metadata.xslt</书社:id>
+       <template match="html:meta[not(@name) and @itemprop='&书社;:title'][&attoplevel;]" mode="书社:metadata">
+               <html:title>
                        <value-of select="@content"/>
-               </comment>
-       </template>
-       <template match="comment()[starts-with(., '[书社:META] ')]" mode="书社:metadata">
-               <variable name="property" select="substring-before(substring-after(., '[书社:META] '), ': ')"/>
-               <variable name="value" select="substring-after(., concat('[书社:META] ', $property, ': '))"/>
-               <choose>
-                       <when test="$property='title'">
-                               <html:title>
-                                       <value-of select="$value"/>
-                               </html:title>
-                       </when>
-               </choose>
+               </html:title>
        </template>
 </transform>
This page took 0.02872 seconds and 4 git commands to generate.