3 ⁌ ⛩️📰 书社 ∷ lib/parser2types.xslt
5 © 2023–2024 Lady [@ Lady’s Computer]
7 This Source Code Form is subject to the terms of the Mozilla Public License, v 2.0.
8 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/>.
11 xmlns="http://www.w3.org/1999/XSL/Transform"
12 xmlns:catalog="urn:oasis:names:tc:entity:xmlns:xml:catalog"
13 xmlns:exslstr="http://exslt.org/strings"
14 xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
15 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
19 <for-each select="//xslt:include">
20 <variable name="included" select="document(@href, .)"/>
22 <when test="$included/*/@书社:supported-media-types">
23 <for-each select="exslstr:tokenize($included/*/@书社:supported-media-types)">
24 <if test="not(translate(., '0123456789abcdefghijklmnopqrstuvwxyz!#$&-^_.+/', ''))">
25 <value-of select="."/>
31 <for-each select="$included//xslt:template[not(@name) and not(@mode)]">
32 <variable name="match" select="@match"/>
33 <for-each select="namespace::*[local-name() and string()='http://www.w3.org/1999/xhtml']">
34 <variable name="matchstart">
35 <value-of select="local-name()"/>
37 <text>script[@type=</text>
39 <if test="starts-with($match, $matchstart) and substring($match, string-length($match))=']' and contains($match, '/')">
40 <variable name="inner" select="substring-before(substring-after($match, $matchstart), ']')"/>
41 <if test="starts-with($inner, '"') and substring($inner, string-length($inner))='"' or starts-with($inner, "'") and substring($inner, string-length($inner))="'"">
42 <variable name="type" select="substring($inner, 2, string-length($inner)-2)"/>
43 <if test="not(translate($type, '0123456789abcdefghijklmnopqrstuvwxyz!#$&-^_.+/', ''))">
44 <value-of select="$type"/>
55 <output method="text" encoding="UTF-8"/>