]> granicus.if.org Git - postgresql/commitdiff
doc: Further speed improvements for HTML XSLT build
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 22 Dec 2016 17:00:00 +0000 (12:00 -0500)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 22 Dec 2016 20:41:44 +0000 (15:41 -0500)
doc/src/sgml/stylesheet-speedup-common.xsl
doc/src/sgml/stylesheet-speedup-xhtml.xsl

index 007fdf6d633347b80c1b2c4bbcdc73971f24f412..e3fb582a1cc9fbaeca933c10b10746a5619ce157 100644 (file)
   </xsl:choose>
 </xsl:template>
 
+<!-- from common/l10n.xsl -->
+
+<!-- Just hardcode the language for the whole document, to make it faster. -->
+
+<xsl:template name="l10n.language">en</xsl:template>
+
 </xsl:stylesheet>
index ff08bef808c92924e2befc2a435ad0fdbd5e82f5..da0f2b5a970e7801f27605ed4ac5a9b00563a603 100644 (file)
   </xsl:call-template>
 </xsl:template>
 
+<xsl:template name="href.target">
+  <xsl:param name="context" select="."/>
+  <xsl:param name="object" select="."/>
+  <xsl:param name="toc-context" select="."/>
+  <!-- Optimization for pgsql-docs: Remove support for dbhtml processing
+       instruction here -->
+  <xsl:variable name="href.to.uri">
+    <xsl:call-template name="href.target.uri">
+      <xsl:with-param name="object" select="$object"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:variable name="href.from.uri">
+    <xsl:choose>
+      <xsl:when test="not($toc-context = .)">
+        <xsl:call-template name="href.target.uri">
+          <xsl:with-param name="object" select="$toc-context"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="href.target.uri">
+          <xsl:with-param name="object" select="$context"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+  <xsl:variable name="href.to">
+    <xsl:value-of select="$href.to.uri"/>
+  </xsl:variable>
+  <xsl:variable name="href.from">
+    <xsl:call-template name="trim.common.uri.paths">
+      <xsl:with-param name="uriA" select="$href.to.uri"/>
+      <xsl:with-param name="uriB" select="$href.from.uri"/>
+      <xsl:with-param name="return" select="'B'"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:variable name="depth">
+    <xsl:call-template name="count.uri.path.depth">
+      <xsl:with-param name="filename" select="$href.from"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:variable name="href">
+    <xsl:call-template name="copy-string">
+      <xsl:with-param name="string" select="'../'"/>
+      <xsl:with-param name="count" select="$depth"/>
+    </xsl:call-template>
+    <xsl:value-of select="$href.to"/>
+  </xsl:variable>
+  <xsl:value-of select="$href"/>
+</xsl:template>
+
 <xsl:template name="html.head">
   <xsl:param name="prev" select="/foo"/>
   <xsl:param name="next" select="/foo"/>