]> Lady’s Gitweb - Shushe/blobdiff - lib/catalog2transform.xslt
Provide template identifiers as <书社:id>s
[Shushe] / lib / catalog2transform.xslt
index 74f7f46b4edf3fdc5f78502664f7584ae58b9941..5098a2cdd38b92d5cc61f587e680cf3a009ad9ee 100644 (file)
@@ -36,6 +36,20 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
        <namespace-alias stylesheet-prefix="xslt" result-prefix="#default"/>
        <param name="METADATA" select="'about:blank'"/>
        <template match="/">
+               <variable name="ids">
+                       <for-each select="//catalog:uri[@name]">
+                               <书社:id>
+                                       <value-of select="@name"/>
+                               </书社:id>
+                       </for-each>
+               </variable>
+               <variable name="unique-ids">
+                       <for-each select="exsl:node-set($ids)/*">
+                               <if test="not(preceding-sibling::*[string(.)=string(current())])">
+                                       <copy-of select="."/>
+                               </if>
+                       </for-each>
+               </variable>
                <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()"/>
@@ -72,11 +86,9 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                        </xslt:variable>
                        <for-each select="//catalog:uri">
                                <xslt:include href="{@uri}">
-                                       <if test="contains(@name, ':')">
-                                               <attribute name="书社:id">
-                                                       <value-of select="@name"/>
-                                               </attribute>
-                                       </if>
+                                       <attribute name="书社:id">
+                                               <value-of select="@name"/>
+                                       </attribute>
                                </xslt:include>
                        </for-each>
                        <xslt:template name="书社:apply-attributes">
@@ -192,7 +204,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                <xslt:param name="nodes" select="/.."/>
                                <xslt:variable name="modalinput-fragment">
                                        <xslt:copy-of select="$nodes"/>
-                                       <xslt:copy-of select="document('')/xslt:transform/xslt:include"/>
+                                       <apply-templates select="exsl:node-set($unique-ids)" mode="书社:literally"/>
                                </xslt:variable>
                                <xslt:variable name="modalinput" select="exsl:node-set($modalinput-fragment)"/>
                                <xslt:variable name="metadata-fragment">
This page took 0.021108 seconds and 4 git commands to generate.