Commits

Anonymous committed 98f08b6

Now compiling the DocBook XML against the snapshot XSL stylesheets.

This handles xml:lang properly and reduces the size of the custom.xsl.

  • Participants
  • Parent commits 45126ee

Comments (0)

Files changed (3)

File hebrew-html-tutorial/Makefile

 
 html-xsl: $(DEST_INDEX) $(DOC)/style.css put-images
 
+# XSL_STYLESHEETS_PATH := /usr/share/sgml/docbook/xsl-stylesheets-db5-1.73.2/xhtml
+
+# This is to use the docbook-xsl-snapshot which should have a better
+# support for xml:lang, etc. See:
+# https://sourceforge.net/tracker/?func=detail&atid=373750&aid=1993833&group_id=21935
+XSL_STYLESHEETS_PATH := $(HOME)/Download/unpack/file/docbook/docbook-xsl-snapshot/xhtml
+
 $(DEST_INDEX): $(DOC).xml custom.xsl
-	xsltproc --path /usr/share/sgml/docbook/xsl-stylesheets-db5-1.73.2/xhtml -o $@ custom.xsl $<
+	xsltproc --path $(XSL_STYLESHEETS_PATH) -o $@ custom.xsl $<
 
 $(DOC)/style.css: style.css
 	cp -f $< $@

File hebrew-html-tutorial/custom.xsl

 <xsl:template name="user.header.content">
     <xsl:call-template name="user.header.navigation"/>
 </xsl:template>
-
-<xsl:template name="paragraph">
-  <xsl:param name="class" select="''"/>
-  <xsl:param name="content"/>
-
-  <xsl:variable name="p">
-    <p>
-      <xsl:call-template name="language.attribute" />
-      <xsl:call-template name="dir"/>
-      <xsl:if test="$class != ''">
-        <xsl:apply-templates select="." mode="class.attribute">
-          <xsl:with-param name="class" select="$class"/>
-        </xsl:apply-templates>
-      </xsl:if>
-      <xsl:copy-of select="$content"/>
-    </p>
-  </xsl:variable>
-
-  <xsl:choose>
-    <xsl:when test="$html.cleanup != 0">
-      <xsl:call-template name="unwrap.p">
-        <xsl:with-param name="p" select="$p"/>
-      </xsl:call-template>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:copy-of select="$p"/>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
-
-<xsl:template match="d:legalnotice" mode="titlepage.mode">
-  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
-  <xsl:choose>
-    <xsl:when test="$generate.legalnotice.link != 0">
-      <xsl:variable name="filename">
-        <xsl:call-template name="make-relative-filename">
-          <xsl:with-param name="base.dir" select="$base.dir"/>
-	  <xsl:with-param name="base.name" select="concat($id,$html.ext)"/>
-        </xsl:call-template>
-      </xsl:variable>
-
-      <xsl:variable name="title">
-        <xsl:apply-templates select="." mode="title.markup"/>
-      </xsl:variable>
-
-      <xsl:variable name="href">
-        <xsl:apply-templates mode="chunk-filename" select="."/>
-      </xsl:variable>
-
-      <a href="{$href}">
-        <xsl:copy-of select="$title"/>
-      </a>
-
-      <xsl:call-template name="write.chunk">
-        <xsl:with-param name="filename" select="$filename"/>
-        <xsl:with-param name="quiet" select="$chunk.quietly"/>
-        <xsl:with-param name="content">
-        <xsl:call-template name="user.preroot"/>
-          <html>
-            <head>
-              <xsl:call-template name="system.head.content"/>
-              <xsl:call-template name="head.content"/>
-              <xsl:call-template name="user.head.content"/>
-            </head>
-            <body>
-              <xsl:call-template name="body.attributes"/>
-              <div>
-                <xsl:apply-templates select="." mode="class.attribute"/>
-                <xsl:apply-templates mode="titlepage.mode"/>
-              </div>
-            </body>
-          </html>
-          <xsl:value-of select="$chunk.append"/>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:when>
-    <xsl:otherwise>
-      <div>
-        <xsl:call-template name="language.attribute" />
-        <xsl:apply-templates select="." mode="class.attribute"/>
-        <a id="{$id}"/>
-        <xsl:apply-templates mode="titlepage.mode"/>
-      </div>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
-
-<xsl:template match="d:programlisting|d:screen|d:synopsis">
-  <xsl:param name="suppress-numbers" select="'0'"/>
-  <xsl:variable name="id">
-    <xsl:call-template name="object.id"/>
-  </xsl:variable>
-
-  <xsl:call-template name="anchor"/>
-
-  <xsl:if test="$shade.verbatim != 0">
-    <xsl:message>
-      <xsl:text>The shade.verbatim parameter is deprecated. </xsl:text>
-      <xsl:text>Use CSS instead,</xsl:text>
-    </xsl:message>
-    <xsl:message>
-      <xsl:text>for example: pre.</xsl:text>
-      <xsl:value-of select="local-name(.)"/>
-      <xsl:text> { background-color: #E0E0E0; }</xsl:text>
-    </xsl:message>
-  </xsl:if>
-
-  <xsl:choose>
-    <xsl:when test="$suppress-numbers = '0'       and @linenumbering = 'numbered'       and $use.extensions != '0'       and $linenumbering.extension != '0'">
-      <xsl:variable name="rtf">
-	<xsl:call-template name="apply-highlighting"/>
-      </xsl:variable>
-      <pre>
-        <xsl:call-template name="language.attribute" />
-        <xsl:apply-templates select="." mode="class.attribute"/>
-	<xsl:call-template name="number.rtf.lines">
-	  <xsl:with-param name="rtf" select="$rtf"/>
-	</xsl:call-template>
-      </pre>
-    </xsl:when>
-    <xsl:otherwise>
-      <pre>
-        <xsl:call-template name="language.attribute" />
-        <xsl:apply-templates select="." mode="class.attribute"/>
-	<xsl:call-template name="apply-highlighting"/>
-      </pre>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
-
-<xsl:template name="inline.charseq">
-  <xsl:param name="content">
-    <xsl:call-template name="anchor"/>
-    <xsl:call-template name="simple.xlink">
-      <xsl:with-param name="content">
-        <xsl:apply-templates/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:param>
-  <!-- * if you want output from the inline.charseq template wrapped in -->
-  <!-- * something other than a Span, call the template with some value -->
-  <!-- * for the 'wrapper-name' param -->
-  <xsl:param name="wrapper-name">span</xsl:param>
-  <xsl:element name="{$wrapper-name}" namespace="http://www.w3.org/1999/xhtml">
-    <xsl:attribute name="class">
-      <xsl:value-of select="local-name(.)"/>
-    </xsl:attribute>
-    <xsl:call-template name="language.attribute" />
-    <xsl:call-template name="dir"/>
-    <xsl:call-template name="generate.html.title"/>
-    <xsl:copy-of select="$content"/>
-    <xsl:call-template name="apply-annotations"/>
-  </xsl:element>
-</xsl:template>
-
-<xsl:template name="inline.monoseq">
-  <xsl:param name="content">
-    <xsl:call-template name="anchor"/>
-    <xsl:call-template name="simple.xlink">
-      <xsl:with-param name="content">
-        <xsl:apply-templates/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:param>
-  <code>
-    <xsl:call-template name="language.attribute" />
-    <xsl:apply-templates select="." mode="class.attribute"/>
-    <xsl:call-template name="dir"/>
-    <xsl:call-template name="generate.html.title"/>
-    <xsl:copy-of select="$content"/>
-    <xsl:call-template name="apply-annotations"/>
-  </code>
-</xsl:template>
 </xsl:stylesheet>

File hebrew-html-tutorial/rejects.xsl

+<xsl:template name="paragraph">
+  <xsl:param name="class" select="''"/>
+  <xsl:param name="content"/>
+
+  <xsl:variable name="p">
+    <p>
+      <xsl:call-template name="language.attribute" />
+      <xsl:call-template name="dir"/>
+      <xsl:if test="$class != ''">
+        <xsl:apply-templates select="." mode="class.attribute">
+          <xsl:with-param name="class" select="$class"/>
+        </xsl:apply-templates>
+      </xsl:if>
+      <xsl:copy-of select="$content"/>
+    </p>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$html.cleanup != 0">
+      <xsl:call-template name="unwrap.p">
+        <xsl:with-param name="p" select="$p"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:copy-of select="$p"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="d:legalnotice" mode="titlepage.mode">
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$generate.legalnotice.link != 0">
+      <xsl:variable name="filename">
+        <xsl:call-template name="make-relative-filename">
+          <xsl:with-param name="base.dir" select="$base.dir"/>
+	  <xsl:with-param name="base.name" select="concat($id,$html.ext)"/>
+        </xsl:call-template>
+      </xsl:variable>
+
+      <xsl:variable name="title">
+        <xsl:apply-templates select="." mode="title.markup"/>
+      </xsl:variable>
+
+      <xsl:variable name="href">
+        <xsl:apply-templates mode="chunk-filename" select="."/>
+      </xsl:variable>
+
+      <a href="{$href}">
+        <xsl:copy-of select="$title"/>
+      </a>
+
+      <xsl:call-template name="write.chunk">
+        <xsl:with-param name="filename" select="$filename"/>
+        <xsl:with-param name="quiet" select="$chunk.quietly"/>
+        <xsl:with-param name="content">
+        <xsl:call-template name="user.preroot"/>
+          <html>
+            <head>
+              <xsl:call-template name="system.head.content"/>
+              <xsl:call-template name="head.content"/>
+              <xsl:call-template name="user.head.content"/>
+            </head>
+            <body>
+              <xsl:call-template name="body.attributes"/>
+              <div>
+                <xsl:apply-templates select="." mode="class.attribute"/>
+                <xsl:apply-templates mode="titlepage.mode"/>
+              </div>
+            </body>
+          </html>
+          <xsl:value-of select="$chunk.append"/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <div>
+        <xsl:call-template name="language.attribute" />
+        <xsl:apply-templates select="." mode="class.attribute"/>
+        <a id="{$id}"/>
+        <xsl:apply-templates mode="titlepage.mode"/>
+      </div>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="d:programlisting|d:screen|d:synopsis">
+  <xsl:param name="suppress-numbers" select="'0'"/>
+  <xsl:variable name="id">
+    <xsl:call-template name="object.id"/>
+  </xsl:variable>
+
+  <xsl:call-template name="anchor"/>
+
+  <xsl:if test="$shade.verbatim != 0">
+    <xsl:message>
+      <xsl:text>The shade.verbatim parameter is deprecated. </xsl:text>
+      <xsl:text>Use CSS instead,</xsl:text>
+    </xsl:message>
+    <xsl:message>
+      <xsl:text>for example: pre.</xsl:text>
+      <xsl:value-of select="local-name(.)"/>
+      <xsl:text> { background-color: #E0E0E0; }</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:choose>
+    <xsl:when test="$suppress-numbers = '0'       and @linenumbering = 'numbered'       and $use.extensions != '0'       and $linenumbering.extension != '0'">
+      <xsl:variable name="rtf">
+	<xsl:call-template name="apply-highlighting"/>
+      </xsl:variable>
+      <pre>
+        <xsl:call-template name="language.attribute" />
+        <xsl:apply-templates select="." mode="class.attribute"/>
+	<xsl:call-template name="number.rtf.lines">
+	  <xsl:with-param name="rtf" select="$rtf"/>
+	</xsl:call-template>
+      </pre>
+    </xsl:when>
+    <xsl:otherwise>
+      <pre>
+        <xsl:call-template name="language.attribute" />
+        <xsl:apply-templates select="." mode="class.attribute"/>
+	<xsl:call-template name="apply-highlighting"/>
+      </pre>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="inline.charseq">
+  <xsl:param name="content">
+    <xsl:call-template name="anchor"/>
+    <xsl:call-template name="simple.xlink">
+      <xsl:with-param name="content">
+        <xsl:apply-templates/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:param>
+  <!-- * if you want output from the inline.charseq template wrapped in -->
+  <!-- * something other than a Span, call the template with some value -->
+  <!-- * for the 'wrapper-name' param -->
+  <xsl:param name="wrapper-name">span</xsl:param>
+  <xsl:element name="{$wrapper-name}" namespace="http://www.w3.org/1999/xhtml">
+    <xsl:attribute name="class">
+      <xsl:value-of select="local-name(.)"/>
+    </xsl:attribute>
+    <xsl:call-template name="language.attribute" />
+    <xsl:call-template name="dir"/>
+    <xsl:call-template name="generate.html.title"/>
+    <xsl:copy-of select="$content"/>
+    <xsl:call-template name="apply-annotations"/>
+  </xsl:element>
+</xsl:template>
+
+<xsl:template name="inline.monoseq">
+  <xsl:param name="content">
+    <xsl:call-template name="anchor"/>
+    <xsl:call-template name="simple.xlink">
+      <xsl:with-param name="content">
+        <xsl:apply-templates/>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:param>
+  <code>
+    <xsl:call-template name="language.attribute" />
+    <xsl:apply-templates select="." mode="class.attribute"/>
+    <xsl:call-template name="dir"/>
+    <xsl:call-template name="generate.html.title"/>
+    <xsl:copy-of select="$content"/>
+    <xsl:call-template name="apply-annotations"/>
+  </code>
+</xsl:template>