Permalink
Browse files

Use centered <bridehead> tag instead of home made table.

  • Loading branch information...
petterreinholdtsen committed Mar 24, 2013
1 parent 77b4a58 commit e05dbacf104ecc438185802608f9fd8fed9b14a8
Showing with 70 additions and 15 deletions.
  1. +2 −14 kodemus.xml
  2. +68 −1 stylesheet-fo.xsl
View
@@ -200,13 +200,7 @@ individets frihet og integritet.</para>
</orderedlist>
</para>
-<informaltable frame="none">
-<tgroup cols="1" align='center'>
-<tbody>
-<row><entry>*</entry></row>
-</tbody>
-</tgroup>
-</informaltable>
+<bridgehead>*</bridgehead>
<para>En morgen våknet Kodémus helt av seg selv. Men altfor sent. Ør
og fortumlet myste han vantro mot Lillebror på nattbordet. <quote>Du
@@ -449,13 +443,7 @@ FARE I: EIERS BALANSE &ndash; FARE II: KUBE-BALANSE &ndash; FARE III:
SAMFUNNS-BALANSE &ndash; EIER? &ndash; KODÉMUS &ndash; KONKLUSJON: KODÉMUS FARE &ndash;
TILTAK? &ndash; TILTAK 120754x</computeroutput></para>
-<informaltable frame="none">
-<tgroup cols="1" align='center'>
-<tbody>
-<row><entry>*</entry></row>
-</tbody>
-</tgroup>
-</informaltable>
+<bridgehead>*</bridgehead>
<para>Kodémus våknet av at noen trettet.
<?linebreak?>
View
@@ -9,4 +9,71 @@
<xsl:include href="user_param.xsl" />
<xsl:param name="paper.type">A4</xsl:param>
<xsl:param name="fop1.extensions">1</xsl:param>
-</xsl:stylesheet>
+
+ <!-- from https://lists.oasis-open.org/archives/docbook-apps/200709/msg00055.html -->
+ <xsl:template name="section.heading">
+ <xsl:param name="level" select="1"/>
+ <xsl:param name="marker" select="1"/>
+ <xsl:param name="title"/>
+ <xsl:param name="marker.title"/>
+
+ <fo:block xsl:use-attribute-sets="section.title.properties">
+ <xsl:if test="$marker != 0">
+ <fo:marker marker-class-name="section.head.marker">
+ <xsl:copy-of select="$marker.title"/>
+ </fo:marker>
+ </xsl:if>
+
+ <xsl:choose>
+ <xsl:when test="$level=1">
+ <fo:block xsl:use-attribute-sets="section.title.level1.properties">
+ <xsl:if test="self::bridgehead">
+ <xsl:attribute name="text-align">center</xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$title"/>
+ </fo:block>
+ </xsl:when>
+ <xsl:when test="$level=2">
+ <fo:block xsl:use-attribute-sets="section.title.level2.properties">
+ <xsl:if test="self::bridgehead">
+ <xsl:attribute name="text-align">center</xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$title"/>
+ </fo:block>
+ </xsl:when>
+ <xsl:when test="$level=3">
+ <fo:block xsl:use-attribute-sets="section.title.level3.properties">
+ <xsl:if test="self::bridgehead">
+ <xsl:attribute name="text-align">center</xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$title"/>
+ </fo:block>
+ </xsl:when>
+ <xsl:when test="$level=4">
+ <fo:block xsl:use-attribute-sets="section.title.level4.properties">
+ <xsl:if test="self::bridgehead">
+ <xsl:attribute name="text-align">center</xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$title"/>
+ </fo:block>
+ </xsl:when>
+ <xsl:when test="$level=5">
+ <fo:block xsl:use-attribute-sets="section.title.level5.properties">
+ <xsl:if test="self::bridgehead">
+ <xsl:attribute name="text-align">center</xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$title"/>
+ </fo:block>
+ </xsl:when>
+ <xsl:otherwise>
+ <fo:block xsl:use-attribute-sets="section.title.level6.properties">
+ <xsl:if test="self::bridgehead">
+ <xsl:attribute name="text-align">center</xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$title"/>
+ </fo:block>
+ </xsl:otherwise>
+ </xsl:choose>
+ </fo:block>
+ </xsl:template>
+</xsl:stylesheet>

0 comments on commit e05dbac

Please sign in to comment.