Author: paul
Date: 2005-10-31 21:46:16 +0100 (Mon, 31 Oct 2005)
New Revision: 204
Log:
r235@kite-hub: paul | 2005-10-31 14:45:55 -0600
Strip <remark> elements before FO-generation stage. Helps remove
unwanted extraneous linebreaks in bullet items.
Added:
trunk/xsl.d/strip-remarks.xsl
Modified:
trunk/
trunk/make.d/xml-pdf
trunk/xsl.d/mysql-fo.xsl
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:3240
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:233
+ b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:3240
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:235
Modified: trunk/make.d/xml-pdf
===================================================================
--- trunk/make.d/xml-pdf 2005-10-31 20:17:55 UTC (rev 203)
+++ trunk/make.d/xml-pdf 2005-10-31 20:46:16 UTC (rev 204)
@@ -4,6 +4,9 @@
MYSQL_FO_XSL = $(XSL_DIR)/mysql-fo.xsl
MYSQL_FO_XSL_DEPS = $(MYSQL_FO_XSL)
+STRIP_REMARKS_XSL = $(XSL_DIR)/strip-remarks.xsl
+STRIP_REMARKS_XSL_DEPS = $(STRIP_REMARKS_XSL)
+
# Assume document language is English unless it's set otherwise
DOC_LANG ?= en
@@ -18,16 +21,20 @@
# for page margins, note that you can't set left and right as they
# will be overwritten. The default value is 1in for both.
-%.fo: %-prepped.xml $(MYSQL_FO_XSL_DEPS)
+%.fo: %-prepped.xml $(MYSQL_FO_XSL_DEPS) $(STRIP_REMARKS_XSL_DEPS)
$(XSLTPROC) \
+ --output - $(STRIP_REMARKS_XSL) $< \
+ | $(XSLTPROC) \
--stringparam l10n.gentext.default.language $(DOC_LANG) \
- --output $@ $(MYSQL_FO_XSL) $<
+ --output $@ $(MYSQL_FO_XSL) -
-%.a4.fo: %-prepped.xml $(MYSQL_FO_XSL_DEPS)
+%.a4.fo: %-prepped.xml $(MYSQL_FO_XSL_DEPS) $(STRIP_REMARKS_XSL_DEPS)
$(XSLTPROC) \
+ --output - $(STRIP_REMARKS_XSL) $< \
+ | $(XSLTPROC) \
--stringparam l10n.gentext.default.language $(DOC_LANG) \
--stringparam paper.type A4 \
- --output $@ $(MYSQL_FO_XSL) $<
+ --output $@ $(MYSQL_FO_XSL) -
# Ignore error messages about hyphenation. FOP produces zillions of these
# if it doesn't have hyphenation tables for a given language.
Modified: trunk/xsl.d/mysql-fo.xsl
===================================================================
--- trunk/xsl.d/mysql-fo.xsl 2005-10-31 20:17:55 UTC (rev 203)
+++ trunk/xsl.d/mysql-fo.xsl 2005-10-31 20:46:16 UTC (rev 204)
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
-Driver stylesheet for generating FO output, but with <remark>
-elements stripped and several parameters preset.
+ mysql-fo.xsl
+ Driver stylesheet for generating FO output, but with
+ several parameters preset.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
@@ -23,7 +24,4 @@
<xsl:param name="page.margin.outer" select="'1in'"/>
<xsl:param name="draft.mode" select="no"/>
-<!-- strip remark elements -->
-<xsl:template match="remark" />
-
</xsl:stylesheet>
Added: trunk/xsl.d/strip-remarks.xsl
===================================================================
--- trunk/xsl.d/strip-remarks.xsl 2005-10-31 20:17:55 UTC (rev 203)
+++ trunk/xsl.d/strip-remarks.xsl 2005-10-31 20:46:16 UTC (rev 204)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<!--
+ strip-remarks.xsl: Identity transform, except that remarks are removed.
+
+ This is used for when producing PDF output because the fo stylesheets
+ sometimes introduce extra linebreaks where a <remark> occurs, even though
+ the content of the <remark> does not appear in the output. For example,
+ with the <remark> present as follows, the bullet item tag appears on the
+ line following the bullet. Preprocessing to remove the <remark> causes the
+ tag to appear on the same line:
+
+ <listitem>
+ <remark>this is some remark</remark>
+ <para>item tag</para>
+ </listitem>
+-->
+
+<xsl:output method="xml"/>
+
+<!-- remove remarks -->
+<xsl:template match="remark"/>
+
+<xsl:template match="node() | @* | processing-instruction()">
+ <xsl:copy>
+ <xsl:apply-templates select="node() | @* | processing-instruction()"/>
+ </xsl:copy>
+</xsl:template>
+
+</xsl:stylesheet>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r204 - in trunk: . make.d xsl.d | paul | 31 Oct |