# (callable) Get the source files for the given parsed file.
override unparsed = $(foreach file,$1,$(patsubst %|$(file),%,$(filter %|$(file),$(sourceparsedpair))))
-# Pair each parser, transform, source file, or parsed file with its file u·r·i.
-override fileuripairs := $(join $(patsubst %,%|,$(PARSERS) $(TRANSFORMS) $(sourcefiles) $(sourceincludes) $(call parsed,$(sourcefiles) $(sourceincludes))),$(call pathenc,$(foreach uriable,$(PARSERS) $(TRANSFORMS) $(sourcefiles) $(sourceincludes) $(call parsed,$(sourcefiles) $(sourceincludes)),file://$(abspath $(uriable)))))
+# Pair each parser, transform, source file, parsed file, or metadata compilation with its file u·r·i.
+override fileuripairs := $(join $(patsubst %,%|,$(PARSERS) $(TRANSFORMS) $(sourcefiles) $(sourceincludes) $(call parsed,$(sourcefiles) $(sourceincludes)) $(BUILDDIR)/metadata),$(call pathenc,$(foreach uriable,$(PARSERS) $(TRANSFORMS) $(sourcefiles) $(sourceincludes) $(call parsed,$(sourcefiles) $(sourceincludes)) $(BUILDDIR)/metadata,file://$(abspath $(uriable)))))
-# (callable) Get the file u·r·is for the given parsers, transforms, or parsed files.
+# (callable) Get the file u·r·is for the given parsers, transforms, parsed files, or metadata compilations.
override fileuri = $(foreach file,$1,$(or $(patsubst $(file)|%,%,$(filter $(file)|%,$(fileuripairs))),$(error Unable to get file u·r·i for `$(file)´)))
ifneq ($(wildcard $(BUILDDIR)/dependencies),)
$(call metadata,$(sourcefiles) $(sourceincludes)) : % : $$(call datadata,$$@) $(typeupdates)
$(call inform,$(PRINTF) '%s\n' $(call quote,Generating metadata for `$<´…) >&2)
$(silent)$(call ensuredirectory,$(dir $@))
- $(silent){ if $(TEST) ! -f $(call quote,$(BUILDDIR)/.mtime); then $(PRINTF) '%b' '\n' >|$(call quote,$(BUILDDIR)/.mtime); fi; $(TOUCH) -r $(call quote,$<) $(call quote,$(BUILDDIR)/.mtime); TZ=UTC0 $(DIFF) -u $(call quote,$(BUILDDIR)/.mtime) /dev/null | $(SED) '1!d;s/.* \([^ ]*\) \([^ ]*\).*$$/\1T\2Z/'; $(CKSUM) $(call quote,$<) | $(SED) 's/[ ].*//'; } | $(xargsmultiquote) | $(XARGS) -E '' $(PRINTF) '<?xml version="1.0"?><nfo:LocalFileDataObject xmlns:dct="http://purl.org/dc/terms/" xmlns:nie="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#" xmlns:nfo="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" rdf:about="%s" nfo:fileUrl="%s"><nie:interpretedAs>$(if $(filter $(source),$(assetfiles)),<nfo:InformationElement nie:mimeType="%s"/>,<nfo:PlainTextDocument nie:mimeType="%s"/>)</nie:interpretedAs><dct:hasFormat><nfo:LocalFileDataObject nfo:fileUrl="%s"><nie:interpretedAs><nfo:PlainTextDocument nie:mimeType="application/xml"/></nie:interpretedAs></nfo:LocalFileDataObject></dct:hasFormat><nfo:fileLastModified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">%s</nfo:fileLastModified><nfo:hasHash nfo:hashAlgorithm="CRC32" nfo:hashValue="%s"/></nfo:LocalFileDataObject>' $(call quote,$(call attresc,$(call localuri,$<))) $(call quote,$(call attresc,$(call fileuri,$<))) $(call quote,$(call attresc,$(call typeoffile,$<))) $(call quote,$(call attresc,$(call fileuri,$(call parsed,$<)))) >|$(call quote,$@)
+ $(silent){ if $(TEST) ! -f $(call quote,$(BUILDDIR)/.mtime); then $(PRINTF) '%b' '\n' >|$(call quote,$(BUILDDIR)/.mtime); fi; $(TOUCH) -r $(call quote,$<) $(call quote,$(BUILDDIR)/.mtime); TZ=UTC0 $(DIFF) -u $(call quote,$(BUILDDIR)/.mtime) /dev/null | $(SED) '1!d;s/.* \([^ ]*\) \([^ ]*\).*$$/\1T\2Z/'; $(CKSUM) $(call quote,$<) | $(SED) 's/[ ].*//'; } | $(xargsmultiquote) | $(XARGS) -E '' $(PRINTF) '<?xml version="1.0"?><nfo:LocalFileDataObject xmlns:dct="http://purl.org/dc/terms/" xmlns:nie="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#" xmlns:nfo="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" rdf:about="%s" nfo:fileUrl="%s"><nie:interpretedAs>$(if $(filter $<,$(assetfiles)),<nfo:InformationElement nie:mimeType="%s"/>,<nfo:PlainTextDocument nie:mimeType="%s"/>)</nie:interpretedAs><dct:hasFormat><nfo:LocalFileDataObject nfo:fileUrl="%s"><nie:interpretedAs><nfo:PlainTextDocument nie:mimeType="application/xml"/></nie:interpretedAs></nfo:LocalFileDataObject></dct:hasFormat><nfo:fileLastModified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">%s</nfo:fileLastModified><nfo:hasHash nfo:hashAlgorithm="CRC32" nfo:hashValue="%s"/></nfo:LocalFileDataObject>' $(call quote,$(call attresc,$(call localuri,$<))) $(call quote,$(call attresc,$(call fileuri,$<))) $(call quote,$(call attresc,$(call typeoffile,$<))) $(call quote,$(call attresc,$(call fileuri,$(call parsed,$<)))) >|$(call quote,$@)
# Parse the files.
#
$(call inform,$(PRINTF) '%s\n' 'Generating catalog of transforms…' >&2)
$(silent)$(XMLCATALOG) --create --noout $(call quote,$@)
$(foreach transform,$(TRANSFORMS),$(silent){ $(call id,$(transform)); $(PRINTF) '%s\n' $(call quote,$(call fileuri,$(transform))) '--noout' $(call quote,$@); } | $(xargsmultiquote) | $(XARGS) -E '' $(XMLCATALOG) --add uri$(newline))
-$(BUILDDIR)/transform.xslt : $(BUILDDIR)/transform.catalog $(THISDIR)/lib/catalog2transform.xslt
+$(BUILDDIR)/transform.xslt : $(BUILDDIR)/transform.catalog $(BUILDDIR)/metadata $(THISDIR)/lib/catalog2transform.xslt
$(call inform,$(PRINTF) '%s\n' 'Generating main transform…' >&2)
- $(silent)$(XSLTPROC) --nonet --novalid -o $(call quote,$@) $(call quote,$(THISDIR)/lib/catalog2transform.xslt) $(call quote,$<)
+ $(silent)$(XSLTPROC) --nonet --novalid -o $(call quote,$@) --stringparam METADATA $(call quote,$(call fileuri,$(BUILDDIR)/metadata)) $(call quote,$(THISDIR)/lib/catalog2transform.xslt) $(call quote,$<)
# Compile the result files using the dependencies as necessary.
$(call compiled,$(compilablefiles)) : $(BUILDDIR)/results/% : $$(call parsed,$$(call uncompiled,$$@)) $$(call parsed,$$(call dependencies,$$(call uncompiled,$$@))) $(BUILDDIR)/transform.xslt $(BUILDDIR)/metadata
### Attributes added during parsing
-⛩️📰 书社 will add a few attributes to the output of the parsing step,
- namely :—
+⛩️📰 书社 will add a few attributes to elements which result from
+ parsing plaintext `<html:script>` elements.
+These include :—
-- For toplevel result elements :—
+- A `@书社:parsed-by` attribute, giving a space‐separated list of
+ parsers which parsed the node.
+ (Generally, this will be a list of one, but it is possible for the
+ result of a parse to be another plaintext node, which may be parsed
+ by a different parser.)
- - A `@书社:cksum` attribute giving the `cksum` checksum of the
- corresponding source file.
+- A `@书社:media-type` attribute, giving the identified media type of
+ the plaintext node.
- - A `@书社:mtime` attribute giving the last modified time of the
- corresponding source file.
-
- - A `@书社:identifier` attribute giving the ⛩️📰 书社 identifier
- (i·e, starting with `about:shushe?`) of the corresponding source
- file.
-
-- For the elements which result from parsing plaintext `<html:script>`
- elements :—
-
- - A `@书社:parsed-by` attribute, giving a space‐separated list of
- parsers which parsed the node.
- (Generally, this will be a list of one, but it is possible for the
- result of a parse to be another plaintext node, which may be
- parsed by a different parser.)
+## Output Redirection
- - A `@书社:media-type` attribute, giving the identified media type of
- the plaintext node.
+By default, ⛩️📰 书社 installs files to the same location in `DESTDIR`
+ as they were placed in their `SRCDIR`.
+This behaviour can be customized by setting the `@书社:destination`
+ attribute on the root element, whose value can give a different path.
+This attribute is read after parsing, but before transformation (where
+ it is silently dropped).
## Embedding
and update them accordingly; it will signal an error if the
dependencies are recursive.
-## Output Redirection
+### Attributes added during expansion
-By default, ⛩️📰 书社 installs files to the same location in `DESTDIR`
- as they were placed in their `SRCDIR`.
-This behaviour can be customized by setting the `@书社:destination`
- attribute on the root element, whose value can give a different path.
-This attribute is read after parsing, but before transformation (where
- it is silently dropped).
+⛩️📰 书社 will add a few attributes to toplevel result elements, both
+ in the main document and any embedded documents, during the expansion
+ phase prior to the main transformation.
+These include :—
+
+- A `@书社:cksum` attribute giving the `cksum` checksum of the
+ corresponding source file.
+
+- A `@书社:mtime` attribute giving the last modified time of the
+ corresponding source file.
+
+- A `@书社:identifier` attribute giving the ⛩️📰 书社 identifier
+ (i·e, starting with `about:shushe?`) of the corresponding source
+ file.
+
+- For elements in the `html` namespace, an `itemscope` attribute and an
+ `itemtype` attribute with a value of
+ `urn:fdc:ladys.computer:20231231:Shu1She4:document` (for the main
+ document) or `urn:fdc:ladys.computer:20231231:Shu1She4:embed` (for
+ embedded documents).
+ These attributes are used to scope any nested `<html:meta>` elements
+ with `@itemprop` attributes to their containing documents.
## Transforms
The following params are only available in transforms :—
-- **`METADATA`:**
- The path of the metadata file (within `BUILDDIR`).
-
- **`PATH`:**
The path of the output file (within `DESTDIR`).
</xslt:for-each>
</xslt:template>
<xslt:template match="/">
- <xslt:variable name="parsedroot">
- <xslt:apply-templates select="node()" mode="书社:parse"/>
- </xslt:variable>
- <xslt:for-each select="exsl:node-set($parsedroot)/node()">
- <xslt:choose>
- <xslt:when test="self::*">
- <xslt:copy>
- <xslt:attribute name="书社:cksum">
- <xslt:value-of select="document('metadata')//*[@rdf:about=$IDENTIFIER]/nfo:hasHash[@nfo:hashAlgorithm='CRC32']/@nfo:hashValue"/>
- </xslt:attribute>
- <xslt:attribute name="书社:identifier">
- <xslt:value-of select="$IDENTIFIER"/>
- </xslt:attribute>
- <xslt:attribute name="书社:mtime">
- <xslt:value-of select="document('metadata')//*[@rdf:about=$IDENTIFIER]/nfo:fileLastModified"/>
- </xslt:attribute>
- <xslt:copy-of select="@*[namespace-uri()!='urn:fdc:ladys.computer:20231231:Shu1She4' or not(contains(' cksum identifier mtime ', concat(' ', local-name(), ' ')))]|node()"/>
- </xslt:copy>
- </xslt:when>
- <xslt:otherwise>
- <xslt:copy-of select="."/>
- </xslt:otherwise>
- </xslt:choose>
- </xslt:for-each>
+ <xslt:apply-templates select="node()" mode="书社:parse"/>
</xslt:template>
<xslt:template match="@*|node()" priority="-1">
<xslt:copy>
exclude-result-prefixes="catalog"
version="1.0"
>
+ <include href="literally.xslt"/>
<namespace-alias stylesheet-prefix="xslt" result-prefix="#default"/>
+ <param name="METADATA" select="'about:blank'"/>
<template match="/">
<xslt:transform exclude-result-prefixes="nie nfo" extension-element-prefixes="exsl exslstr" version="1.0">
<xslt:param name="BUILDTIME" select="'1972-12-31T00:00:00Z'"/>
<xslt:param name="IDENTIFIER" select="false()"/>
- <xslt:param name="METADATA" select="'metadata'"/>
<xslt:param name="PATH" select="'/unknown'"/>
<xslt:param name="SRCREV" select="false()"/>
<xslt:param name="THISREV" select="false()"/>
<xslt:variable name="书社:source" select="/"/>
- <xslt:variable name="书社:expansion">
+ <xslt:variable name="书社:about-fragment">
+ <apply-templates select="document($METADATA)" mode="书社:literally"/>
+ </xslt:variable>
+ <xslt:variable name="书社:about" select="exsl:node-set($书社:about-fragment)"/>
+ <xslt:variable name="书社:expansion-fragment">
<xslt:apply-templates select="$书社:source/node()" mode="书社:expand"/>
</xslt:variable>
- <xslt:variable name="书社:result">
- <xslt:apply-templates select="exsl:node-set($书社:expansion)/node()"/>
+ <xslt:variable name="书社:expansion" select="exsl:node-set($书社:expansion-fragment)"/>
+ <xslt:variable name="书社:result-fragment">
+ <xslt:apply-templates select="$书社:expansion/node()"/>
</xslt:variable>
+ <xslt:variable name="书社:result" select="exsl:node-set($书社:result-fragment)"/>
<xslt:variable name="书社:destination">
<xslt:choose>
<xslt:when test="string($书社:source/@书社:destination)!=''">
</html:html>
</xslt:template>
<xslt:template match="/" priority="1">
- <xslt:variable name="result-nodes" select="exsl:node-set($书社:result)/node()[not(self::书社:apply-attributes-to-root)]|exsl:node-set($书社:result)/书社:apply-attributes-to-root/descendant::node()[not(self::书社:apply-attributes-to-root) and not(ancestor::*[not(self::书社:apply-attributes-to-root)])]"/>
+ <xslt:variable name="result-nodes" select="$书社:result/node()[not(self::书社:apply-attributes-to-root)]|$书社:result/书社:apply-attributes-to-root/descendant::node()[not(self::书社:apply-attributes-to-root) and not(ancestor::*[not(self::书社:apply-attributes-to-root)])]"/>
<xslt:variable name="root-with-attributes">
<xslt:choose>
- <xslt:when test="$result-nodes/self::书社:*[local-name()='raw-text' or local-name()='base64-binary' or local-name()='archive']|$result-nodes/@书社:disable-output-wrapping|exsl:node-set($书社:result)//书社:apply-attributes-to-root/@书社:disable-output-wrapping">
+ <xslt:when test="$result-nodes/self::书社:*[local-name()='raw-text' or local-name()='base64-binary' or local-name()='archive']|$result-nodes/@书社:disable-output-wrapping|$书社:result//书社:apply-attributes-to-root/@书社:disable-output-wrapping">
<xslt:call-template name="书社:apply-attributes">
<xslt:with-param name="and-version" select="true()"/>
- <xslt:with-param name="context-nodes" select="exsl:node-set($书社:result)//书社:apply-attributes-to-root"/>
+ <xslt:with-param name="context-nodes" select="$书社:result//书社:apply-attributes-to-root"/>
<xslt:with-param name="destination-nodes" select="$result-nodes"/>
</xslt:call-template>
</xslt:when>
</xslt:variable>
<xslt:call-template name="书社:apply-attributes">
<xslt:with-param name="and-version" select="true()"/>
- <xslt:with-param name="context-nodes" select="exsl:node-set($书社:result)//书社:apply-attributes-to-root"/>
+ <xslt:with-param name="context-nodes" select="$书社:result//书社:apply-attributes-to-root"/>
<xslt:with-param name="destination-nodes" select="exsl:node-set($wrapped-result)/node()"/>
</xslt:call-template>
</xslt:otherwise>
</xslt:choose>
</xslt:variable>
- <xslt:apply-templates select="exsl:node-set($root-with-attributes)/node()" mode="书社:application"/>
+ <xslt:apply-templates select="exsl:node-set($root-with-attributes)/node()" mode="书社:apply"/>
</xslt:template>
<xslt:template match="@*|node()" priority="-1">
<xslt:copy>
<xslt:apply-templates select="@*|node()"/>
</xslt:copy>
</xslt:template>
- <xslt:template match="@*|node()" mode="书社:application">
+ <xslt:template match="@*|node()" mode="书社:apply">
<xslt:copy>
- <xslt:apply-templates select="@*|node()" mode="书社:application"/>
+ <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="书社:application" priority="1"/>
- <xslt:template match="书社:archive" mode="书社:application" priority="1">
+ <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:for-each select="@*">
<xslt:choose>
<xslt:when test="local-name()='archived-as' and namespace-uri()='&书社;' and ../ancestor::*[not(self::书社:apply-attributes-to-root or self::书社:apply-attributes)]"/>
<xslt:otherwise>
- <xslt:apply-templates select="." mode="书社:application"/>
+ <xslt:apply-templates select="." mode="书社:apply"/>
</xslt:otherwise>
</xslt:choose>
</xslt:for-each>
</xslt:otherwise>
</xslt:choose>
</xslt:variable>
- <xslt:apply-templates select="exsl:node-set($component)/node()" mode="书社:application"/>
+ <xslt:apply-templates select="exsl:node-set($component)/node()" mode="书社:apply"/>
</xslt:when>
<xslt:otherwise>
- <xslt:apply-templates select="." mode="书社:application"/>
+ <xslt:apply-templates select="." mode="书社:apply"/>
</xslt:otherwise>
</xslt:choose>
</xslt:for-each>
</xslt:copy>
</xslt:template>
- <xslt:template match="书社:apply-attributes" mode="书社:application" priority="1">
+ <xslt:template match="书社:apply-attributes" mode="书社:apply" priority="1">
<xslt:variable name="children">
- <xslt:apply-templates mode="书社:application"/>
+ <xslt:apply-templates mode="书社:apply"/>
</xslt:variable>
<xslt:call-template name="书社:apply-attributes">
<xslt:with-param name="context-nodes" select="."/>
<xslt:with-param name="destination-nodes" select="exsl:node-set($children)/node()"/>
</xslt:call-template>
</xslt:template>
- <xslt:template match="书社:apply-attributes-to-root" mode="书社:application" priority="1">
- <xslt:apply-templates mode="书社:application"/>
- </xslt:template>
- <xslt:template match="/node()" mode="书社:expand" priority="0">
- <xslt:copy>
- <xslt:choose>
- <xslt:when test="self::html:*">
- <xslt:attribute name="itemscope">itemscope</xslt:attribute>
- <xslt:attribute name="itemtype">
- <xslt:text>
- <text>&书社;:document</text>
- </xslt:text>
- <xslt:for-each select="exslstr:tokenize(@itemtype)/token">
- <xslt:text>
- <text> </text>
- </xslt:text>
- <xslt:value-of select="."/>
- </xslt:for-each>
- </xslt:attribute>
- <xslt:apply-templates select="@*[not(namespace-uri()='' and (local-name()='itemscope' or local-name()='itemtype'))]|node()" mode="书社:expand"/>
- </xslt:when>
- <xslt:otherwise>
- <xslt:apply-templates select="@*|node()" mode="书社:expand"/>
- </xslt:otherwise>
- </xslt:choose>
- </xslt:copy>
+ <xslt:template match="书社:apply-attributes-to-root" mode="书社:apply" priority="1">
+ <xslt:apply-templates mode="书社:apply"/>
</xslt:template>
<xslt:template match="书社:link[@xlink:show='embed']" mode="书社:expand" priority="1">
<xslt:variable name="identifier" select="string(@xlink:href)"/>
<xslt:choose>
<xslt:when test="$uri">
<xslt:variable name="expanded">
- <xslt:apply-templates select="document($uri)" mode="书社:expand"/>
+ <xslt:apply-templates select="document($uri)" mode="书社:expand">
+ <xslt:with-param name="identifier" select="$identifier"/>
+ </xslt:apply-templates>
</xslt:variable>
<xslt:for-each select="exsl:node-set($expanded)/node()">
<xslt:copy>
</xslt:otherwise>
</xslt:choose>
</xslt:template>
+ <xslt:template match="/node()" mode="书社:expand" priority="0">
+ <xslt:param name="identifier" select="$IDENTIFIER"/>
+ <xslt:copy>
+ <xslt:if test="self::*">
+ <xslt:attribute name="书社:cksum">
+ <xslt:value-of select="$书社:about//*[@rdf:about=$identifier]/nfo:hasHash[@nfo:hashAlgorithm='CRC32']/@nfo:hashValue"/>
+ </xslt:attribute>
+ <xslt:attribute name="书社:identifier">
+ <xslt:value-of select="$identifier"/>
+ </xslt:attribute>
+ <xslt:attribute name="书社:mtime">
+ <xslt:value-of select="$书社:about//*[@rdf:about=$identifier]/nfo:fileLastModified"/>
+ </xslt:attribute>
+ </xslt:if>
+ <xslt:choose>
+ <xslt:when test="self::html:*">
+ <xslt:attribute name="itemscope">itemscope</xslt:attribute>
+ <xslt:attribute name="itemtype">
+ <xslt:text>
+ <text>&书社;:document</text>
+ </xslt:text>
+ <xslt:for-each select="exslstr:tokenize(@itemtype)/token">
+ <xslt:text>
+ <text> </text>
+ </xslt:text>
+ <xslt:value-of select="."/>
+ </xslt:for-each>
+ </xslt:attribute>
+ <xslt:apply-templates select="@*[not(namespace-uri()='' and (local-name()='itemscope' or local-name()='itemtype') or namespace-uri()='&书社;' and (local-name()='cksum' or local-name()='identifier' or local-name()='mtime'))]|node()" mode="书社:expand"/>
+ </xslt:when>
+ <xslt:otherwise>
+ <xslt:apply-templates select="@*[not(namespace-uri()='&书社;' and (local-name()='cksum' or local-name()='identifier' or local-name()='mtime'))]|node()" mode="书社:expand"/>
+ </xslt:otherwise>
+ </xslt:choose>
+ </xslt:copy>
+ </xslt:template>
<xslt:template match="@*|node()[not(self::书社:link) or not(@xlink:show='embed')]" mode="书社:expand" priority="-1">
<xslt:copy>
<xslt:apply-templates select="@*|node()" mode="书社:expand"/>
--- /dev/null
+<?xml version="1.0"?>
+<!--
+SPDX-FileCopyrightText: 2024 Lady <https://www.ladys.computer/about/#lady>
+SPDX-License-Identifier: MPL-2.0
+-->
+<!--
+⁌ ⛩️📰 书社 ∷ lib/literally.xslt
+
+© 2024 Lady [@ Lady’s Computer].
+
+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/>.
+-->
+<transform
+ xmlns="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xslt="http://www.w3.org/1999/XSL/TransformAlias"
+ xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
+ version="1.0"
+>
+ <template match="node()" mode="书社:literally">
+ <choose>
+ <when test="self::*">
+ <xslt:element name="{name()}" namespace="{namespace-uri()}">
+ <for-each select="@*">
+ <xslt:attribute name="{name()}" namespace="{namespace-uri()}">
+ <xslt:text>
+ <value-of select="."/>
+ </xslt:text>
+ </xslt:attribute>
+ </for-each>
+ <apply-templates mode="书社:literally"/>
+ </xslt:element>
+ </when>
+ <when test="self::text()">
+ <xslt:text>
+ <value-of select="."/>
+ </xslt:text>
+ </when>
+ <when test="self::processing-instruction()">
+ <xslt:processing-instruction name="{local-name()}">
+ <xslt:text>
+ <value-of select="."/>
+ </xslt:text>
+ </xslt:processing-instruction>
+ </when>
+ <when test="self::comment()">
+ <xslt:comment>
+ <xslt:text>
+ <value-of select="."/>
+ </xslt:text>
+ </xslt:comment>
+ </when>
+ <otherwise>
+ <apply-templates mode="书社:literally"/>
+ </otherwise>
+ </choose>
+ </template>
+</transform>
</html:video>
</template>
<template match="xslt:include[@书社:id='urn:fdc:ladys.computer:20231231:Shu1She4:asset.xslt']" mode="书社:metadata">
- <for-each select="exsl:node-set($书社:expansion)//html:object[@type='text/css']">
+ <for-each select="$书社:expansion//html:object[@type='text/css']">
<html:link rel="stylesheet" type="text/css" href="{@data}">
<copy-of select="@书社:identifier"/>
</html:link>
</for-each>
- <for-each select="exsl:node-set($书社:expansion)//html:style">
+ <for-each select="$书社:expansion//html:style">
<copy-of select="."/>
</for-each>
</template>
>
<import href="../lib/serialize.xslt"/>
<书社:id>urn:fdc:ladys.computer:20231231:Shu1She4:serialization.xslt</书社:id>
- <template match="书社:serialize-xml" mode="书社:application" priority="1">
+ <template match="书社:serialize-xml" mode="书社:apply" priority="1">
<variable name="namespaces" select="namespace::*"/>
<variable name="contents">
- <apply-templates mode="书社:application"/>
+ <apply-templates mode="书社:apply"/>
</variable>
<variable name="passthru-namespaces" select="exslstr:tokenize(string(@with-namespaces))"/>
<apply-templates select="exsl:node-set($contents)" mode="书社:serialize">