]> Lady’s Gitweb - Shushe/commitdiff
Apply parser attributes before reparsing current
authorLady <redacted>
Sat, 30 Aug 2025 17:24:24 +0000 (13:24 -0400)
committerLady <redacted>
Sat, 30 Aug 2025 17:24:24 +0000 (13:24 -0400)
This supports the beneficial case of wanting to match on
`@书社:parsed-by` or `@书社:media-type` in (re)parsers.

lib/catalog2parser.xslt

index b23ecc2e95ae449c08075e727e54f8d0cb639a0c..b24495c0ccb9ddbd910b92ecd7a48ade74832162 100644 (file)
@@ -154,17 +154,17 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                <xslt:variable name="parserdiv" select="exsl:node-set($书社:parsers)//html:div[html:dd=current()/@type]"/>
                                <xslt:choose>
                                        <xslt:when test="$parserdiv">
-                                               <xslt:variable name="result">
+                                               <xslt:variable name="result-fragment">
                                                        <xslt:apply-templates select="."/>
                                                </xslt:variable>
-                                               <xslt:variable name="reparsed-result">
-                                                       <xslt:apply-templates select="exsl:node-set($result)/node()" mode="书社:parse"/>
+                                               <xslt:variable name="applied-fragment">
+                                                       <xslt:call-template name="书社:apply-parsed-by">
+                                                               <xslt:with-param name="id" select="string($parserdiv/html:dt)"/>
+                                                               <xslt:with-param name="media-type" select="string(@type)"/>
+                                                               <xslt:with-param name="result" select="exsl:node-set($result-fragment)"/>
+                                                       </xslt:call-template>
                                                </xslt:variable>
-                                               <xslt:call-template name="书社:apply-parsed-by">
-                                                       <xslt:with-param name="id" select="string($parserdiv/html:dt)"/>
-                                                       <xslt:with-param name="media-type" select="string(@type)"/>
-                                                       <xslt:with-param name="result" select="exsl:node-set($reparsed-result)"/>
-                                               </xslt:call-template>
+                                               <xslt:apply-templates select="exsl:node-set($applied-fragment)/node()" mode="书社:parse"/>
                                        </xslt:when>
                                        <xslt:otherwise>
                                                <xslt:apply-templates select="."/>
This page took 0.027914 seconds and 4 git commands to generate.