- <xslt:template match="书社:apply-attributes" mode="书社:application" priority="1">
- <xslt:variable name="children">
- <xslt:apply-templates mode="书社:application"/>
- </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:attribute name="书社:identifier">
- <xslt:value-of select="$IDENTIFIER"/>
- </xslt:attribute>
- <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>
- <xslt:template match="书社:link[@xlink:show='embed']" mode="书社:expand" priority="1">
- <xslt:variable name="identifier" select="string(@xlink:href)"/>
- <xslt:variable name="uri" select="document($METADATA)//*[@rdf:about=$identifier]/dct:hasFormat/*[nie:interpretedAs/*[@nie:mimeType='application/xml']]/@nfo:fileUrl[1]"/>