doc: Further XSLT HTML build performance optimization
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 16 Nov 2016 20:00:00 +0000 (12:00 -0800)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 16 Nov 2016 19:53:35 +0000 (11:53 -0800)
Cut out some expensive stuff from the HTML head element that we don't
really need.

This was previously discussed as part of
e8306745e3504c642f7abad411139d5630e29fac, but ended up separate because
it changes the output contents slightly.

doc/src/sgml/stylesheet-speedup-xhtml.xsl

index 53c811cab021142436b48fc5521f1c6ee609323d..ff08bef808c92924e2befc2a435ad0fdbd5e82f5 100644 (file)
   </xsl:call-template>
 </xsl:template>
 
+<xsl:template name="html.head">
+  <xsl:param name="prev" select="/foo"/>
+  <xsl:param name="next" select="/foo"/>
+
+  <!-- Optimization for pgsql-docs: Cut out a bunch of things we don't need
+       here, including an expensive //legalnotice search. -->
+
+  <head>
+    <xsl:call-template name="system.head.content"/>
+    <xsl:call-template name="head.content"/>
+
+    <xsl:if test="$prev">
+      <link rel="prev">
+        <xsl:attribute name="href">
+          <xsl:call-template name="href.target">
+            <xsl:with-param name="object" select="$prev"/>
+          </xsl:call-template>
+        </xsl:attribute>
+        <xsl:attribute name="title">
+          <xsl:apply-templates select="$prev" mode="object.title.markup.textonly"/>
+        </xsl:attribute>
+      </link>
+    </xsl:if>
+
+    <xsl:if test="$next">
+      <link rel="next">
+        <xsl:attribute name="href">
+          <xsl:call-template name="href.target">
+            <xsl:with-param name="object" select="$next"/>
+          </xsl:call-template>
+        </xsl:attribute>
+        <xsl:attribute name="title">
+          <xsl:apply-templates select="$next" mode="object.title.markup.textonly"/>
+        </xsl:attribute>
+      </link>
+    </xsl:if>
+
+    <xsl:call-template name="user.head.content"/>
+  </head>
+</xsl:template>
+
 </xsl:stylesheet>