- <for-each select="document(@href, .)//xslt:template[not(@name) and not(@mode)]">
- <variable name="match" select="@match"/>
- <for-each select="namespace::*[local-name() and string()='http://www.w3.org/1999/xhtml']">
- <variable name="matchstart">
- <value-of select="local-name()"/>
- <text>:</text>
- <text>script[@type=</text>
- </variable>
- <if test="starts-with($match, $matchstart) and substring($match, string-length($match))=']' and contains($match, '/')">
- <variable name="inner" select="substring-before(substring-after($match, $matchstart), ']')"/>
- <if test="starts-with($inner, '"') and substring($inner, string-length($inner))='"' or starts-with($inner, "'") and substring($inner, string-length($inner))="'"">
- <variable name="type" select="substring($inner, 2, string-length($inner)-2)"/>
- <if test="not(translate($type, '0123456789abcdefghijklmnopqrstuvwxyz!#$&-^_.+/', ''))">
- <value-of select="$type"/>
- <text>
</text>
- </if>
+ <variable name="included" select="document(@href, .)"/>
+ <choose>
+ <when test="$included/*/@书社:supported-media-types">
+ <for-each select="exslstr:tokenize($included/*/@书社:supported-media-types)">
+ <if test="not(translate(., '0123456789abcdefghijklmnopqrstuvwxyz!#$&-^_.+/', ''))">
+ <value-of select="."/>
+ <text>
</text>