3 ⁌ ⛩️📰 书社 ∷ lib/parser2types.xslt
5 © 2023 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:xslt="http://www.w3.org/1999/XSL/Transform"
14 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
18 <for-each select="//xslt:include">
19 <for-each select="document(@href, .)//xslt:template[not(@name) and not(@mode)]">
20 <variable name="match" select="@match"/>
21 <for-each select="namespace::*[local-name() and string()='http://www.w3.org/1999/xhtml']">
22 <variable name="matchstart">
23 <value-of select="local-name()"/>
25 <text>script[@type=</text>
27 <if test="starts-with($match, $matchstart) and substring($match, string-length($match))=']' and contains($match, '/')">
28 <variable name="inner" select="substring-before(substring-after($match, $matchstart), ']')"/>
29 <if test="starts-with($inner, '"') and substring($inner, string-length($inner))='"' or starts-with($inner, "'") and substring($inner, string-length($inner))="'"">
30 <variable name="type" select="substring($inner, 2, string-length($inner)-2)"/>
31 <if test="not(translate($type, '0123456789abcdefghijklmnopqrstuvwxyz!#$&-^_.+/', ''))">
32 <value-of select="$type"/>
41 <output method="text" encoding="UTF-8"/>