It’s reasonable to expect ordinary transforms to create new
`<html:style>` and `<html:object>` elements, and these should be
handled as well.
media types into the appropriate H·T·M·L elements, and deletes
`<html:style>` elements from the body of the document and moves
them to the head.
media types into the appropriate H·T·M·L elements, and deletes
`<html:style>` elements from the body of the document and moves
them to the head.
+ This conversion happens during the application phase, after the main
+ transformation.
- **`transforms/metadata.xslt`:**
Provides basic `<html:head>` metadata.
- **`transforms/metadata.xslt`:**
Provides basic `<html:head>` metadata.
<xslt:apply-templates select="@*|node()"/>
</xslt:copy>
</xslt:template>
<xslt:apply-templates select="@*|node()"/>
</xslt:copy>
</xslt:template>
- <xslt:template match="@*|node()" mode="书社:apply">
- <xslt:copy>
- <xslt:apply-templates select="@*|node()" mode="书社:apply"/>
- </xslt:copy>
- </xslt:template>
<xslt:template match="@书社:destination|@书社:disable-output-wrapping|@书社:archived-as[../ancestor::*[not(self::书社:apply-attributes-to-root or self::书社:apply-attributes)]]" mode="书社:apply" priority="1"/>
<xslt:template match="书社:archive" mode="书社:apply" priority="1">
<xslt:copy>
<xslt:template match="@书社:destination|@书社:disable-output-wrapping|@书社:archived-as[../ancestor::*[not(self::书社:apply-attributes-to-root or self::书社:apply-attributes)]]" mode="书社:apply" priority="1"/>
<xslt:template match="书社:archive" mode="书社:apply" priority="1">
<xslt:copy>
<xslt:template match="书社:apply-attributes-to-root" mode="书社:apply" priority="1">
<xslt:apply-templates mode="书社:apply"/>
</xslt:template>
<xslt:template match="书社:apply-attributes-to-root" mode="书社:apply" priority="1">
<xslt:apply-templates mode="书社:apply"/>
</xslt:template>
+ <xslt:template match="@*|node()" mode="书社:apply" priority="-1">
+ <xslt:copy>
+ <xslt:apply-templates select="@*|node()" mode="书社:apply"/>
+ </xslt:copy>
+ </xslt:template>
<xslt:template match="书社:link[@xlink:show='embed' and (not(@xlink:actuate) or @xlink:actuate='none')]" mode="书社:expand" priority="1">
<xslt:variable name="identifier" select="string(@xlink:href)"/>
<xslt:variable name="included" select="$书社:about//*[@rdf:about=$identifier]"/>
<xslt:template match="书社:link[@xlink:show='embed' and (not(@xlink:actuate) or @xlink:actuate='none')]" mode="书社:expand" priority="1">
<xslt:variable name="identifier" select="string(@xlink:href)"/>
<xslt:variable name="included" select="$书社:about//*[@rdf:about=$identifier]"/>
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/>.
-->
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"
<transform
xmlns="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
version="1.0"
>
<书社:id>urn:fdc:ladys.computer:20231231:Shu1She4:asset.xslt</书社:id>
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; and not(ancestor::html:head)]|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>
<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>
<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">
- <copy-of select="@书社:identifier"/>
+ <copy-of select="@书社:identifier|@width|@height"/>
- <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}">
<html:video controls="" src="{@data}">
- <copy-of select="@书社:identifier"/>
+ <copy-of select="@书社:identifier|@width|@height"/>
</html:video>
</template>
<template match="书社:id[string(.)='urn:fdc:ladys.computer:20231231:Shu1She4:asset.xslt']" mode="书社:metadata">
</html:video>
</template>
<template match="书社:id[string(.)='urn:fdc:ladys.computer:20231231:Shu1She4:asset.xslt']" mode="书社:metadata">
<copy-of select="@书社:identifier"/>
</html:link>
</for-each>
<copy-of select="@书社:identifier"/>
</html:link>
</for-each>
- <for-each select="$书社:expansion//html:style">
+ <for-each select="$书社:expansion//html:style[not(ancestor::html:head)]">
<copy-of select="."/>
</for-each>
</template>
<copy-of select="."/>
</for-each>
</template>