]> Lady’s Gitweb - Shushe/blob - transforms/asset.xslt
Do asset transforms during application
[Shushe] / transforms / asset.xslt
1 <?xml version="1.0"?>
2 <!--
3 SPDX-FileCopyrightText: 2023, 2024 Lady <https://www.ladys.computer/about/#lady>
4 SPDX-License-Identifier: MPL-2.0
5 -->
6 <!--
7 ⁌ ⛩📰 书社 ∷ transforms/asset.xslt
8
9 © 2023–2024 Lady [@ Ladys Computer].
10
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/>.
13 -->
14 <!DOCTYPE transform [
15 <!ENTITY wrapped "ancestor::html:html[not(parent::* or @书社:disable-output-wrapping)]">
16 ]>
17 <transform
18 xmlns="http://www.w3.org/1999/XSL/Transform"
19 xmlns:exsl="http://exslt.org/common"
20 xmlns:html="http://www.w3.org/1999/xhtml"
21 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
22 extension-element-prefixes="exsl"
23 version="1.0"
24 >
25 <书社:id>urn:fdc:ladys.computer:20231231:Shu1She4:asset.xslt</书社:id>
26 <template match="html:style[&wrapped; and not(ancestor::html:head)]|html:object[@type='text/css' and &wrapped;]" mode="书社:apply" priority="0"/>
27 <template match="html:object[@type='text/javascript']" mode="书社:apply" priority="0">
28 <html:script type="{@type}" src="{@data}">
29 <copy-of select="@书社:identifier"/>
30 </html:script>
31 </template>
32 <template match="html:object[starts-with(@type, 'audio/')]" mode="书社:apply" priority="0">
33 <html:audio controls="" src="{@data}">
34 <copy-of select="@书社:identifier"/>
35 </html:audio>
36 </template>
37 <template match="html:object[starts-with(@type, 'image/') and not(@type='image/svg+xml')]" mode="书社:apply" priority="0">
38 <html:img src="{@data}">
39 <copy-of select="@书社:identifier|@width|@height"/>
40 </html:img>
41 </template>
42 <template match="html:object[starts-with(@type, 'video/')]" mode="书社:apply" priority="0">
43 <html:video controls="" src="{@data}">
44 <copy-of select="@书社:identifier|@width|@height"/>
45 </html:video>
46 </template>
47 <template match="书社:id[string(.)='urn:fdc:ladys.computer:20231231:Shu1She4:asset.xslt']" mode="书社:metadata">
48 <for-each select="$书社:expansion//html:object[@type='text/css']">
49 <html:link rel="stylesheet" type="text/css" href="{@data}">
50 <copy-of select="@书社:identifier"/>
51 </html:link>
52 </for-each>
53 <for-each select="$书社:expansion//html:style[not(ancestor::html:head)]">
54 <copy-of select="."/>
55 </for-each>
56 </template>
57 </transform>
This page took 0.293657 seconds and 5 git commands to generate.