- <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:variable name="existing-types" select="exslstr:tokenize(@itemtype)"/>
- <xslt:attribute name="itemscope">itemscope</xslt:attribute>
- <xslt:attribute name="itemtype">
- <xslt:for-each select="$existing-types/token">
- <xslt:if test="position()!=1">
- <xslt:text>
- <text> </text>
- </xslt:text>
- </xslt:if>
- <xslt:value-of select="."/>
- </xslt:for-each>
- <xslt:if test="not($existing-types/token[string()='&书社;:embed' or string()='&书社;:document'])">
- <xslt:if test="$existing-types/token">
- <xslt:text>
- <text> </text>
- </xslt:text>
- </xslt:if>
- <xslt:text>
- <text>&书社;:document</text>
- </xslt:text>
- </xslt:if>
- </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()" mode="书社:expand" priority="-1">