]> Lady’s Gitweb - Shushe/commitdiff
Don’t remove invalid @书社:* attributes
authorLady <redacted>
Fri, 20 Sep 2024 03:21:04 +0000 (23:21 -0400)
committerLady <redacted>
Fri, 20 Sep 2024 03:21:04 +0000 (23:21 -0400)
There is a lot of difficult logic particularly around
`@书社:archived-as` to remove it if it won’t have any effect. This is
unnecessary and it is probably better to just leave these attributes
untouched (akin to how `<书社:link>` is left untouched when invalid).

lib/catalog2transform.xslt

index 2c555e32c189c0ade8b54990a7ed439910f40b46..10a5479a4ff4f5ea2d9c5e93cd6818b394dac322 100644 (file)
@@ -143,8 +143,8 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                                                        <xslt:choose>
                                                                                <xslt:when test="@namespace-uri='&xml;'"/>
                                                                                <xslt:when test="$context[self::html:* or self::svg:*] and @namespace-uri='' and @local-name='lang'"/>
-                                                                               <xslt:when test="@namespace-uri='&书社;' and @local-name='archived-as' and $context-nodes/ancestor::*[not(self::书社:apply-attributes-to-root or self::书社:apply-attributes)][position()=1 and not(self::书社:archive)]"/>
-                                                                               <xslt:when test="@namespace-uri='&书社;' and (@local-name='destination' or @local-name='disable-output-wrapping' or @local-name='version')"/>
+                                                                               <xslt:when test="$and-version and $THISREV and @namespace-uri='&书社;' and @local-name='version'"/>
+                                                                               <xslt:when test="@namespace-uri='&书社;' and (@local-name='destination' or @local-name='disable-output-wrapping')"/>
                                                                                <xslt:when test="preceding-sibling::*[@local-name=current()/@local-name and @namespace-uri=current()/@namespace-uri]"/>
                                                                                <xslt:otherwise>
                                                                                        <xslt:attribute>
@@ -294,17 +294,10 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                        <xslt:apply-templates select="@*|node()"/>
                                </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="书社:apply" priority="1"/>
+                       <xslt:template match="@书社:destination|@书社:disable-output-wrapping" 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="书社:apply"/>
-                                                       </xslt:otherwise>
-                                               </xslt:choose>
-                                       </xslt:for-each>
+                                       <xslt:apply-templates select="@*" mode="书社:apply"/>
                                        <xslt:for-each select="node()">
                                                <xslt:choose>
                                                        <xslt:when test="self::*">
This page took 0.032468 seconds and 4 git commands to generate.