X-Git-Url: https://git.ladys.computer/Shushe/blobdiff_plain/8d1379f31be03acadc1c3ea420799df3e93c924c..bc1b63801488992c309f0b8bd1d5a772b7e5645e:/transforms/asset.xslt?ds=sidebyside diff --git a/transforms/asset.xslt b/transforms/asset.xslt index 575e536..60c76c7 100644 --- a/transforms/asset.xslt +++ b/transforms/asset.xslt @@ -4,45 +4,47 @@ SPDX-FileCopyrightText: 2023, 2024 Lady <https://www.ladys.computer/about/#lady> SPDX-License-Identifier: MPL-2.0 --> <!-- -⁌ ⛩️📰 书社 ∷ transforms/asset.xslt +⁌ ⛩📰 书社 ∷ transforms/asset.xslt -© 2023–2024 Lady [@ Lady’s 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/>. --> +<!DOCTYPE transform [ + <!ENTITY wrapped "ancestor::html:html[not(parent::* or @书社:disable-output-wrapping)]"> +]> <transform xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:html="http://www.w3.org/1999/xhtml" - xmlns:xslt="http://www.w3.org/1999/XSL/Transform" xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4" extension-element-prefixes="exsl" version="1.0" > <书社:id>urn:fdc:ladys.computer:20231231:Shu1She4:asset.xslt</书社:id> - <template match="html:style|html:object[@type='text/css']"/> - <template match="html:object[@type='text/javascript']"> + <template match="html:style[&wrapped;]|html:object[@type='text/css' and &wrapped;]" mode="书社:apply" priority="0"/> + <template match="html:object[@type='text/javascript']" mode="书社:apply" priority="0"> <html:script type="{@type}" src="{@data}"> <copy-of select="@书社:identifier"/> </html:script> </template> - <template match="html:object[starts-with(@type, 'audio/')]"> + <template match="html:object[starts-with(@type, 'audio/')]" mode="书社:apply" priority="0"> <html:audio controls="" src="{@data}"> <copy-of select="@书社:identifier"/> </html:audio> </template> - <template match="html:object[starts-with(@type, 'image/') and not(@type='image/svg+xml')]"> + <template match="html:object[starts-with(@type, 'image/') and not(@type='image/svg+xml')]" mode="书社:apply" priority="0"> <html:img src="{@data}"> - <copy-of select="@书社:identifier"/> + <copy-of select="@书社:identifier|@width|@height"/> </html:img> </template> - <template match="html:object[starts-with(@type, 'video/')]"> + <template match="html:object[starts-with(@type, 'video/')]" mode="书社:apply" priority="0"> <html:video controls="" src="{@data}"> - <copy-of select="@书社:identifier"/> + <copy-of select="@书社:identifier|@width|@height"/> </html:video> </template> - <template match="xslt:include[@书社:id='urn:fdc:ladys.computer:20231231:Shu1She4:asset.xslt']" mode="书社:metadata"> + <template match="书社:id[string(.)='urn:fdc:ladys.computer:20231231:Shu1She4:asset.xslt']" mode="书社:metadata"> <for-each select="$书社:expansion//html:object[@type='text/css']"> <html:link rel="stylesheet" type="text/css" href="{@data}"> <copy-of select="@书社:identifier"/>