]> Lady’s Gitweb - Shushe/blobdiff - transforms/asset.xslt
Don’t use literal result elements in transforms
[Shushe] / transforms / asset.xslt
index 2b4359510c0ace6bf6025e71f5d2c6fc089b1bd7..89f1475598f78bf318947bd031cc53c2ecbaafb8 100644 (file)
@@ -13,11 +13,12 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
 -->
 <!DOCTYPE transform [
        <!ENTITY wrapped "ancestor::html:html[not(parent::* or @书社:disable-output-wrapping)]">
 -->
 <!DOCTYPE transform [
        <!ENTITY wrapped "ancestor::html:html[not(parent::* or @书社:disable-output-wrapping)]">
+       <!ENTITY xhtml "http://www.w3.org/1999/xhtml">
 ]>
 <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"
-       xmlns:html="http://www.w3.org/1999/xhtml"
+       xmlns:html="&xhtml;"
        xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
        extension-element-prefixes="exsl"
        version="1.0"
        xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
        extension-element-prefixes="exsl"
        version="1.0"
@@ -25,30 +26,56 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
        <书社:id>urn:fdc:ladys.computer:20231231:Shu1She4:asset.xslt</书社:id>
        <template match="html:style[&wrapped; and not(ancestor::html:head)]|html:object[@type='text/css' and &wrapped;]" mode="书社:finalize" priority="0"/>
        <template match="html:object[@type='text/javascript']" mode="书社:finalize" priority="0">
        <书社:id>urn:fdc:ladys.computer:20231231:Shu1She4:asset.xslt</书社:id>
        <template match="html:style[&wrapped; and not(ancestor::html:head)]|html:object[@type='text/css' and &wrapped;]" mode="书社:finalize" priority="0"/>
        <template match="html:object[@type='text/javascript']" mode="书社:finalize" priority="0">
-               <html:script type="{@type}" src="{@data}">
+               <element name="script" namespace="&xhtml;">
+                       <attribute name="type">
+                               <value-of select="@type"/>
+                       </attribute>
+                       <attribute name="src">
+                               <value-of select="@data"/>
+                       </attribute>
                        <copy-of select="@书社:identifier"/>
                        <copy-of select="@书社:identifier"/>
-               </html:script>
+               </element>
        </template>
        <template match="html:object[starts-with(@type, 'audio/')]" mode="书社:finalize" priority="0">
        </template>
        <template match="html:object[starts-with(@type, 'audio/')]" mode="书社:finalize" priority="0">
-               <html:audio controls="" src="{@data}">
+               <element name="audio" namespace="&xhtml;">
+                       <attribute name="controls"/>
+                       <attribute name="src">
+                               <value-of select="@data"/>
+                       </attribute>
                        <copy-of select="@书社:identifier"/>
                        <copy-of select="@书社:identifier"/>
-               </html:audio>
+               </element>
        </template>
        <template match="html:object[starts-with(@type, 'image/') and not(@type='image/svg+xml')]" mode="书社:finalize" priority="0">
        </template>
        <template match="html:object[starts-with(@type, 'image/') and not(@type='image/svg+xml')]" mode="书社:finalize" priority="0">
-               <html:img src="{@data}">
+               <element name="img" namespace="&xhtml;">
+                       <attribute name="src">
+                               <value-of select="@data"/>
+                       </attribute>
                        <copy-of select="@书社:identifier|@width|@height"/>
                        <copy-of select="@书社:identifier|@width|@height"/>
-               </html:img>
+               </element>
        </template>
        <template match="html:object[starts-with(@type, 'video/')]" mode="书社:finalize" priority="0">
        </template>
        <template match="html:object[starts-with(@type, 'video/')]" mode="书社:finalize" priority="0">
-               <html:video controls="" src="{@data}">
+               <element name="video" namespace="&xhtml;">
+                       <attribute name="controls"/>
+                       <attribute name="src">
+                               <value-of select="@data"/>
+                       </attribute>
                        <copy-of select="@书社:identifier|@width|@height"/>
                        <copy-of select="@书社:identifier|@width|@height"/>
-               </html:video>
+               </element>
        </template>
        <template match="书社:id[string(.)='urn:fdc:ladys.computer:20231231:Shu1She4:asset.xslt']" mode="书社:metadata">
                <for-each select="$书社:expansion//html:object[@type='text/css']">
        </template>
        <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}">
+                       <element name="link" namespace="&xhtml;">
+                               <attribute name="rel">
+                                       <text>stylesheet</text>
+                               </attribute>
+                               <attribute name="type">
+                                       <text>text/css</text>
+                               </attribute>
+                               <attribute name="href">
+                                       <value-of select="@data"/>
+                               </attribute>
                                <copy-of select="@书社:identifier"/>
                                <copy-of select="@书社:identifier"/>
-                       </html:link>
+                       </element>
                </for-each>
                <for-each select="$书社:expansion//html:style[not(ancestor::html:head)]">
                        <copy-of select="."/>
                </for-each>
                <for-each select="$书社:expansion//html:style[not(ancestor::html:head)]">
                        <copy-of select="."/>
This page took 0.036157 seconds and 4 git commands to generate.