3 SPDX-FileCopyrightText: 2023, 2024 Lady <https://www.ladys.computer/about/#lady>
4 SPDX-License-Identifier: MPL-2.0
7 ⁌ ⛩📰 书社 ∷ transforms/asset.xslt
9 © 2023–2024 Lady [@ Ladys Computer].
11 This Source Code Form is subject to the terms of the Mozilla Public License, v 2.0.
12 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/>.
15 <!ENTITY wrapped "ancestor::html:html[not(parent::* or @书社:disable-output-wrapping)]">
16 <!ENTITY xhtml "http://www.w3.org/1999/xhtml">
19 xmlns="http://www.w3.org/1999/XSL/Transform"
20 xmlns:exsl="http://exslt.org/common"
22 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
23 extension-element-prefixes="exsl"
26 <书社:id>urn:fdc:ladys.computer:20231231:Shu1She4:asset.xslt</书社:id>
27 <template match="html:style[&wrapped; and not(ancestor::html:head)]|html:object[@type='text/css' and &wrapped;]" mode="书社:finalize" priority="0"/>
28 <template match="html:object[@type='text/javascript']" mode="书社:finalize" priority="0">
29 <element name="script" namespace="&xhtml;">
30 <attribute name="type">
31 <value-of select="@type"/>
33 <attribute name="src">
34 <value-of select="@data"/>
36 <copy-of select="@书社:identifier"/>
39 <template match="html:object[starts-with(@type, 'audio/')]" mode="书社:finalize" priority="0">
40 <element name="audio" namespace="&xhtml;">
41 <attribute name="controls"/>
42 <attribute name="src">
43 <value-of select="@data"/>
45 <copy-of select="@书社:identifier"/>
48 <template match="html:object[starts-with(@type, 'image/') and not(@type='image/svg+xml')]" mode="书社:finalize" priority="0">
49 <element name="img" namespace="&xhtml;">
50 <attribute name="src">
51 <value-of select="@data"/>
53 <copy-of select="@书社:identifier|@width|@height"/>
56 <template match="html:object[starts-with(@type, 'video/')]" mode="书社:finalize" priority="0">
57 <element name="video" namespace="&xhtml;">
58 <attribute name="controls"/>
59 <attribute name="src">
60 <value-of select="@data"/>
62 <copy-of select="@书社:identifier|@width|@height"/>
65 <template match="书社:id[string(.)='urn:fdc:ladys.computer:20231231:Shu1She4:asset.xslt']" mode="书社:metadata">
66 <for-each select="$书社:expansion//html:object[@type='text/css']">
67 <element name="link" namespace="&xhtml;">
68 <attribute name="rel">
69 <text>stylesheet</text>
71 <attribute name="type">
74 <attribute name="href">
75 <value-of select="@data"/>
77 <copy-of select="@书社:identifier"/>
80 <for-each select="$书社:expansion//html:style[not(ancestor::html:head)]">