You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by fu...@apache.org on 2006/09/07 07:38:11 UTC
svn commit: r440981 - in /db/derby/docs/trunk: build.xml
lib/dita2fo-shell.xsl lib/dita2fo-titles.xsl lib/domains2fo.xsl
lib/topic2fo-shell.xsl lib/topic2foImpl.xsl lib/topicmerge.xsl
Author: fuzzylogic
Date: Wed Sep 6 22:38:10 2006
New Revision: 440981
URL: http://svn.apache.org/viewvc?view=rev&rev=440981
Log:
DERBY-408: Fix formatting of syntax boxes and numbering of tables in HTML Book
and PDF manuals.
Added:
db/derby/docs/trunk/lib/dita2fo-titles.xsl (with props)
db/derby/docs/trunk/lib/domains2fo.xsl (with props)
db/derby/docs/trunk/lib/topic2fo-shell.xsl (with props)
db/derby/docs/trunk/lib/topic2foImpl.xsl (with props)
db/derby/docs/trunk/lib/topicmerge.xsl (with props)
Modified:
db/derby/docs/trunk/build.xml
db/derby/docs/trunk/lib/dita2fo-shell.xsl
Modified: db/derby/docs/trunk/build.xml
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/build.xml?view=diff&rev=440981&r1=440980&r2=440981
==============================================================================
--- db/derby/docs/trunk/build.xml (original)
+++ db/derby/docs/trunk/build.xml Wed Sep 6 22:38:10 2006
@@ -60,6 +60,11 @@
<target name="unpack.dita" unless="dita.available">
<unjar src="${dita.zip}" dest="${basedir}"/>
<copy file="${dita.lib.dir}/dita2fo-shell.xsl" todir="${dita.dir}/xsl"/>
+ <copy file="${dita.lib.dir}/topicmerge.xsl" todir="${dita.dir}/xsl"/>
+ <copy file="${dita.lib.dir}/topic2fo-shell.xsl" todir="${dita.dir}/xsl"/>
+ <copy file="${dita.lib.dir}/dita2fo-titles.xsl" todir="${dita.dir}/xsl/xslfo"/>
+ <copy file="${dita.lib.dir}/topic2foImpl.xsl" todir="${dita.dir}/xsl/xslfo"/>
+ <copy file="${dita.lib.dir}/domains2fo.xsl" todir="${dita.dir}/xsl/xslfo"/>
</target>
<target name="html.workingwithderby" depends="init">
Modified: db/derby/docs/trunk/lib/dita2fo-shell.xsl
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/lib/dita2fo-shell.xsl?view=diff&rev=440981&r1=440980&r2=440981
==============================================================================
--- db/derby/docs/trunk/lib/dita2fo-shell.xsl (original)
+++ db/derby/docs/trunk/lib/dita2fo-shell.xsl Wed Sep 6 22:38:10 2006
@@ -41,7 +41,7 @@
<xsl:import href="xslfo/topic2foImpl.xsl"/>
<xsl:import href="xslfo/domains2fo.xsl"/>
<!-- XSL-FO output with XML syntax; no actual doctype for FO -->
- <xsl:output method="xml" version="1.0" indent="yes"/>
+ <xsl:output method="xml" version="1.0"/>
<!-- CONTROL PARAMETERS: -->
<!-- offset -->
<xsl:param name="basic-start-indent">72pt</xsl:param>
Added: db/derby/docs/trunk/lib/dita2fo-titles.xsl
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/lib/dita2fo-titles.xsl?view=auto&rev=440981
==============================================================================
--- db/derby/docs/trunk/lib/dita2fo-titles.xsl (added)
+++ db/derby/docs/trunk/lib/dita2fo-titles.xsl Wed Sep 6 22:38:10 2006
@@ -0,0 +1,245 @@
+<?xml version='1.0'?>
+<!-- (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved. -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version='1.0'>
+
+
+
+<!-- =================== start of element rules ====================== -->
+
+<!-- NESTED TOPIC TITLES (sensitive to nesting depth, but are still processed for contained markup) -->
+
+<!-- h1 -->
+<xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="2">
+ <fo:block xsl:use-attribute-sets="topictitle1" id="{generate-id()}" padding-top="1.4pc">
+ <fo:block border-top-color="black" border-top-width="3pt" line-height="100%"
+ border-left-width="0pt" border-right-width="0pt">
+ <xsl:call-template name="get-title"/>
+ </fo:block>
+ </fo:block>
+</xsl:template>
+
+
+<!-- h2 -->
+<xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="3">
+ <fo:block xsl:use-attribute-sets="topictitle2" id="{generate-id()}" padding-top="1pc">
+ <fo:block border-top-color="black" border-top-width="1pt"
+ border-left-width="0pt" border-right-width="0pt">
+ <xsl:call-template name="get-title"/>
+ </fo:block>
+ </fo:block>
+</xsl:template>
+
+<!-- h3 -->
+<xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="4">
+ <fo:block xsl:use-attribute-sets="topictitle3" id="{generate-id()}">
+ <xsl:call-template name="get-title"/>
+ </fo:block>
+</xsl:template>
+
+<!-- h4 -->
+<xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="5">
+ <fo:block xsl:use-attribute-sets="topictitle4" id="{generate-id()}">
+ <xsl:if test="$trace='yes'"><fo:inline color="purple"></fo:inline></xsl:if>
+ <xsl:call-template name="get-title"/>
+ </fo:block>
+</xsl:template>
+
+<!-- h5 -->
+<xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="6">
+ <fo:block xsl:use-attribute-sets="topictitle5" id="{generate-id()}">
+ <xsl:call-template name="get-title"/><xsl:text>: </xsl:text>
+ </fo:block>
+</xsl:template>
+
+<!-- h6 -->
+<xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="7">
+ <fo:block xsl:use-attribute-sets="topictitle6" id="{generate-id()}">
+ <xsl:call-template name="get-title"/><xsl:text>: </xsl:text>
+ </fo:block>
+</xsl:template>
+
+
+
+
+
+<!-- section/title handling -->
+
+<xsl:template match="*[contains(@class,' topic/section ')]/*[contains(@class,' topic/title ')]">
+ <fo:block font-weight="bold">
+ <xsl:apply-templates/>
+ </fo:block>
+</xsl:template>
+
+
+<!-- example/title handing -->
+
+<xsl:template match="*[contains(@class,' topic/example ')]/*[contains(@class,' topic/title ')]">
+ <fo:block font-weight="bold">
+ <xsl:apply-templates/>
+ </fo:block>
+</xsl:template>
+
+
+<!-- table/title handling -->
+
+<xsl:template match="*[contains(@class,' topic/table ')]/*[contains(@class,' topic/title ')]">
+ <xsl:variable name="tbl-pfx-txt">
+ <xsl:call-template name="getString">
+ <xsl:with-param name="stringName" select="'Table'"/>
+ </xsl:call-template>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="count(preceding::*[contains(@class,' topic/table ')]/*[contains(@class,' topic/title ')])+1"/>
+ </xsl:variable>
+ <fo:block font-weight="bold">
+ <fo:inline color="red"><xsl:value-of select="$tbl-pfx-txt"/>. </fo:inline>
+ <xsl:apply-templates/>
+ </fo:block>
+</xsl:template>
+
+
+<!-- fig/title handling -->
+
+<xsl:template match="*[contains(@class,' topic/fig ')]/*[contains(@class,' topic/title ')]">
+ <xsl:variable name="fig-pfx-txt">
+ <xsl:call-template name="getString">
+ <xsl:with-param name="stringName" select="'Figure'"/>
+ </xsl:call-template>
+ <xsl:number level="single" count="title" from="/" />
+ </xsl:variable>
+ <fo:block font-weight="bold">
+ <fo:inline color="red"><xsl:value-of select="$fig-pfx-txt"/>. </fo:inline>
+ <xsl:apply-templates/>
+ </fo:block>
+</xsl:template>
+
+
+
+
+<xsl:template name="place-tbl-lbl">
+<xsl:variable name="tbl-count"> <!-- Number of table/title's before this one -->
+ <xsl:number count="*/table/title" level="multiple"/> <!-- was ANY-->
+</xsl:variable>
+<xsl:variable name="tbl-count-actual"> <!-- Number of table/title's including this one -->
+ <xsl:choose>
+ <xsl:when test="not($tbl-count>0) and not($tbl-count=0) and not($tbl-count<0)">1</xsl:when>
+ <xsl:otherwise><xsl:value-of select="$tbl-count+1"/></xsl:otherwise>
+ </xsl:choose>
+</xsl:variable>
+ <xsl:choose>
+ <xsl:when test="*[contains(@class,' topic/title ')]">
+ <fo:block><fo:inline font-weight="bold">
+ <xsl:call-template name="getString">
+ <xsl:with-param name="stringName" select="'Table'"/>
+ </xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="$tbl-count-actual"/>.<xsl:text> </xsl:text>
+ <xsl:apply-templates select="*[contains(@class,' topic/title ')]" mode="exhibittitle"/>
+ </fo:inline>
+ <xsl:if test="*[contains(@class,' topic/desc ')]">
+ <xsl:text>. </xsl:text><xsl:apply-templates select="*[contains(@class,' topic/desc ')]" mode="exhibitdesc"/>
+ </xsl:if>
+ </fo:block>
+ </xsl:when>
+ <xsl:when test="*[contains(@class,' topic/desc ')]">
+ <fo:block>****<xsl:value-of select="*[contains(@class,' topic/desc ')]"/></fo:block>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
+
+<xsl:template name="place-fig-lbl">
+<xsl:variable name="fig-count"> <!-- Number of fig/title's before this one -->
+ <xsl:number count="*/fig/title" level="multiple"/>
+</xsl:variable>
+<xsl:variable name="fig-count-actual"> <!-- Number of fig/title's including this one -->
+ <xsl:choose>
+ <xsl:when test="not($fig-count>0) and not($fig-count=0) and not($fig-count<0)">1</xsl:when>
+ <xsl:otherwise><xsl:value-of select="$fig-count+1"/></xsl:otherwise>
+ </xsl:choose>
+</xsl:variable>
+ <xsl:choose>
+ <xsl:when test="*[contains(@class,' topic/title ')]">
+ <fo:block><fo:inline font-weight="bold">
+ <xsl:call-template name="getString">
+ <xsl:with-param name="stringName" select="'Figure'"/>
+ </xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="$fig-count-actual"/>.<xsl:text> </xsl:text>
+ <xsl:apply-templates select="*[contains(@class,' topic/title ')]" mode="exhibittitle"/>
+ </fo:inline>
+ <xsl:if test="desc">
+ <xsl:text>. </xsl:text><xsl:apply-templates select="*[contains(@class,' topic/desc ')]" mode="exhibitdesc"/>
+ </xsl:if>
+ </fo:block>
+ </xsl:when>
+ <xsl:when test="*[contains(@class, ' topic/desc ')]">
+ <fo:block>****<xsl:value-of select="*[contains(@class,' topic/desc ')]"/></fo:block>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
+
+
+<!-- ======== NAMED TEMPLATES for labels and titles related to topic structures ======== -->
+
+<xsl:template name="get-title"><!-- get fully-processed title content by whatever mechanism -->
+ <!-- insert anchor for PDF bookmark, using id attribute of topic element -->
+ <!-- inserting the anchor here ensures that it is on the same page as the topic title, not the page before -->
+ <xsl:apply-templates select="parent::*/@id"/>
+ <xsl:choose>
+ <!-- add keycol here once implemented -->
+ <xsl:when test="@spectitle">
+ <xsl:value-of select="@spectitle"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/> <!-- select="title|*[contains(@class,' topic/title ')]"/-->
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+
+<xsl:template name="get-sect-heading">
+ <xsl:choose>
+ <!-- replace with keyref once implemented -->
+ <xsl:when test="@spectitle">
+ <xsl:value-of select="@spectitle"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="title"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<xsl:template name="sect-heading">
+ <xsl:param name="deftitle" select="."/> <!-- get param by reference -->
+ <xsl:variable name="heading">
+ <xsl:choose>
+ <xsl:when test="*[contains(@class,' topic/title ')]">
+ <xsl:value-of select="*[contains(@class,' topic/title ')]"/>
+ </xsl:when>
+ <xsl:when test="@spectitle">
+ <xsl:value-of select="@spectitle"/>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- based on graceful defaults, build an appropriate section-level heading -->
+ <xsl:choose>
+ <xsl:when test="not($heading='')">
+ <xsl:if test="normalize-space($heading)=''">
+ <!-- hack: a title with whitespace ALWAYS overrides as null -->
+ <!--xsl:comment>no heading</xsl:comment-->
+ </xsl:if>
+ <!--xsl:call-template name="proc-ing"/--><xsl:value-of select="$heading"/>
+ </xsl:when>
+ <xsl:when test="$deftitle">
+ <xsl:value-of select="$deftitle"/>
+ </xsl:when>
+ <xsl:otherwise><!-- no heading title, output section starting with a break --></xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+</xsl:stylesheet>
Propchange: db/derby/docs/trunk/lib/dita2fo-titles.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: db/derby/docs/trunk/lib/domains2fo.xsl
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/lib/domains2fo.xsl?view=auto&rev=440981
==============================================================================
--- db/derby/docs/trunk/lib/domains2fo.xsl (added)
+++ db/derby/docs/trunk/lib/domains2fo.xsl Wed Sep 6 22:38:10 2006
@@ -0,0 +1,554 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved. -->
+
+<!-- domains2fo.xsl
+ | DITA domains support for the demo set; extend as needed
+
+ *-->
+
+<xsl:transform version="1.0"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output method="xml" version="1.0"/>
+
+
+<!-- Start of UI domain -->
+
+<xsl:template match="*[contains(@class,' ui-d/uicontrol ')]">
+ <!-- insert an arrow before all but the first uicontrol in a menucascade -->
+ <xsl:if test="ancestor::*[contains(@class,' ui-d/menucascade ')]">
+ <xsl:variable name="uicontrolcount"><xsl:number count="*[contains(@class,' ui-d/uicontrol ')]"/></xsl:variable>
+ <xsl:if test="$uicontrolcount>'1'">
+ <xsl:text> --> </xsl:text>
+ </xsl:if>
+ </xsl:if>
+ <fo:inline font-weight="bold">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:apply-templates/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' ui-d/wintitle ')]">
+ <fo:inline>
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:apply-templates/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' ui-d/menucascade ')]">
+ <fo:inline>
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:apply-templates/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' ui-d/shortcut ')]">
+ <fo:inline text-decoration="underline">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:apply-templates/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' ui-d/screen ')]">
+ <xsl:call-template name="gen-att-label"/>
+ <fo:block xsl:use-attribute-sets="pre">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="setscale"/>
+<!-- rules have to be applied within the scope of the PRE box; else they start from page margin! -->
+ <xsl:if test="contains(@frame,'top')"><fo:block><fo:leader leader-pattern="rule" leader-length="5.65in" /></fo:block></xsl:if>
+ <xsl:apply-templates/>
+ <xsl:if test="contains(@frame,'bot')"><fo:block><fo:leader leader-pattern="rule" leader-length="5.65in" /></fo:block></xsl:if>
+ </fo:block>
+</xsl:template>
+
+
+<!-- start of highlighting domain -->
+
+<xsl:template match="*[contains(@class,' hi-d/b ')]">
+ <fo:inline font-weight="bold">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' hi-d/i ')]">
+ <fo:inline font-style="italic">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' hi-d/u ')]">
+ <fo:inline text-decoration="underline">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' hi-d/tt ')]">
+ <fo:inline font-family="Courier">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' hi-d/sup ')]">
+ <fo:inline baseline-shift="super" font-size="75%">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:apply-templates/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' hi-d/sub ')]">
+ <fo:inline baseline-shift="sub" font-size="75%">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:apply-templates/>
+ </fo:inline>
+</xsl:template>
+
+
+<!-- start of programming domain -->
+
+<xsl:template match="*[contains(@class,' pr-d/codeph ')]">
+ <fo:inline font-family="Courier">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/codeblock ')]">
+ <xsl:call-template name="gen-att-label"/>
+ <fo:block xsl:use-attribute-sets="pre">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="setscale"/>
+<!-- rules have to be applied within the scope of the PRE box; else they start from page margin! -->
+ <xsl:if test="contains(@frame,'top')"><fo:block><fo:leader leader-pattern="rule" leader-length="5.65in" /></fo:block></xsl:if>
+ <xsl:apply-templates/>
+ <xsl:if test="contains(@frame,'bot')"><fo:block><fo:leader leader-pattern="rule" leader-length="5.65in" /></fo:block></xsl:if>
+ </fo:block>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/option ')]">
+ <fo:inline>
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/var ')]">
+ <fo:inline font-style="italic">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/parmname ')]">
+ <fo:inline>
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/synph ')]">
+ <fo:inline>
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/oper ')]">
+ <fo:inline font-family="Courier">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/delim ')]">
+ <fo:inline font-family="Courier">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/sep ')]">
+ <fo:inline font-family="Courier">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+
+<xsl:template match="*[contains(@class,' pr-d/apiname ')]">
+ <fo:inline font-family="Courier">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/parml ')]">
+ <xsl:call-template name="gen-att-label"/>
+ <fo:block>
+ <xsl:apply-templates select="@id"/>
+ <xsl:apply-templates/>
+ </fo:block>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/plentry ')]">
+ <xsl:apply-templates/>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/pt ')]">
+ <fo:block xsl:use-attribute-sets="dt">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:choose>
+ <xsl:when test="*"> <!-- tagged content - do not default to bold -->
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:otherwise>
+ <fo:inline font-weight="bold"><xsl:call-template name="apply-for-phrases"/></fo:inline> <!-- text only - bold it -->
+ </xsl:otherwise>
+ </xsl:choose>
+ </fo:block>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/pd ')]">
+ <fo:block xsl:use-attribute-sets="dd">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:apply-templates />
+ </fo:block>
+</xsl:template>
+
+
+<!-- syntax diagram -->
+
+<xsl:template match="*[contains(@class,' pr-d/synblk ')]">
+ <fo:inline>
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template name="gen-synnotes">
+ <fo:block font-weight="bold">Notes:</fo:block>
+ <xsl:for-each select="//*[contains(@class,' pr-d/synnote ')]">
+ <xsl:call-template name="dosynnt"/>
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template name="dosynnt"> <!-- creates a list of endnotes of synnt content -->
+ <xsl:variable name="callout">
+ <xsl:choose>
+ <xsl:when test="@callout"><xsl:value-of select="@callout"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="@id"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!--a name="{@id}"-->{<xsl:value-of select="$callout"/>}<!--/a-->
+<!--
+ <table border="1" cellpadding="6">
+ <tr><td bgcolor="LightGrey">
+ <xsl:apply-templates/>
+ </td></tr>
+ </table>
+-->
+ <fo:block><xsl:apply-templates/></fo:block>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/synnoteref ')]">
+<fo:inline baseline-shift="super" font-size="75%">
+<!--
+ <xsl:element name="a">
+ <xsl:attribute name="href">#FNsrc_<xsl:value-of select="@refid"/>
+ </xsl:attribute>
+-->
+ [<xsl:value-of select="@refid"/>]
+<!--
+ </xsl:element>
+-->
+</fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/synnote ')]">
+<fo:inline baseline-shift="super" font-size="75%">
+ <xsl:choose>
+ <xsl:when test="not(@id='')"> <!-- case of an explicit id -->
+ <xsl:value-of select="@id"/>
+ </xsl:when>
+ <xsl:when test="not(@callout='')"> <!-- case of an explicit callout (presume id for now) -->
+ <xsl:value-of select="@callout"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>*</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+</fo:inline>
+</xsl:template>
+
+
+
+<xsl:template match="*[contains(@class,' pr-d/syntaxdiagram ')]">
+<fo:block>
+ <xsl:apply-templates/>
+</fo:block>
+</xsl:template>
+
+<xsl:template match="*[contains(@class,' pr-d/fragment ')]">
+<fo:block>
+ <xsl:value-of select="*[contains(@class,' topic/title ')]"/><xsl:text> </xsl:text>
+ <xsl:apply-templates/>
+</fo:block>
+</xsl:template>
+
+<!-- Title is optional-->
+<xsl:template match="*[contains(@class,' pr-d/syntaxdiagram ')]/*[contains(@class,' topic/title ')]">
+<fo:block font-weight="bold">
+ <xsl:value-of select="."/>
+</fo:block>
+</xsl:template>
+
+<!-- Basically, we want to hide his content. -->
+<xsl:template match="*[contains(@class,' pr-d/repsep ')]"/>
+
+
+<xsl:template match="*[contains(@class,' pr-d/kwd ')]">
+<fo:inline font-family="Courier">
+ <xsl:if test="parent::*[contains(@class,' pr-d/groupchoice ')]">
+ <xsl:if test="count(preceding-sibling::*)!=0"> | </xsl:if>
+ </xsl:if>
+ <xsl:if test="@importance='optional'"> [</xsl:if>
+ <xsl:choose>
+ <xsl:when test="@importance='default'">
+ <fo:inline text-decoration="underline"><xsl:value-of select="."/></fo:inline>
+ </xsl:when>
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="@importance='optional'">] </xsl:if>
+</fo:inline>
+</xsl:template>
+
+<!-- This should test to see if there's a fragment with matching title
+and if so, produce an associative link. -->
+<xsl:template match="*[contains(@class,' pr-d/fragref ')]" priority="100">
+<fo:inline font-family="Courier">
+ <!--a><xsl:attribute name="href">#<xsl:value-of select="."/></xsl:attribute-->
+ <<xsl:value-of select="."/>><!--/a-->
+</fo:inline>
+</xsl:template>
+
+<!-- Where is the template for var with a priority of 50? -->
+<xsl:template match="*[contains(@class,' pr-d/var ')]" priority="51">
+ <fo:inline font-style="italic">
+ <xsl:if test="parent::*[contains(@class,' pr-d/groupchoice ')]">
+ <xsl:if test="count(preceding-sibling::*)!=0"> | </xsl:if>
+ </xsl:if>
+ <xsl:if test="@importance='optional'"> [</xsl:if>
+ <xsl:choose>
+ <xsl:when test="@importance='default'">
+ <fo:inline text-decoration="underline"><xsl:value-of select="."/></fo:inline>
+ </xsl:when>
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="@importance='optional'">] </xsl:if>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/fragment ')]/*[contains(@class,' topic/title ')]">
+ <fo:block font-weight="bold"><xsl:apply-templates/></fo:block>
+</xsl:template>
+
+<xsl:template match="*[contains(@class,' pr-d/fragment ')]/*[contains(@class,' pr-d/groupcomp ')]|*[contains(@class,' pr-d/fragment ')]/*[contains(@class,' pr-d/groupchoice ')]|*[contains(@class,' pr-d/fragment ')]/*[contains(@class,' pr-d/groupseq ')]">
+ <fo:block><!--indent this?-->
+ <xsl:call-template name="dogroup"/>
+ </fo:block>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' pr-d/syntaxdiagram ')]/*[contains(@class,' pr-d/groupcomp ')]|*[contains(@class,' pr-d/syntaxdiagram ')]/*[contains(@class,' pr-d/groupseq ')]|*[contains(@class,' pr-d/syntaxdiagram ')]/*[contains(@class,' pr-d/groupchoice ')]">
+ <xsl:call-template name="dogroup"/>
+</xsl:template>
+
+
+<!-- okay, here we have to work each permutation because figgroup/figroup fallback is too general -->
+<xsl:template match="*[contains(@class,' pr-d/groupcomp ')]/*[contains(@class,' pr-d/groupcomp ')]">
+ <xsl:call-template name="dogroup"/>
+</xsl:template>
+
+<xsl:template match="*[contains(@class,' pr-d/groupchoice ')]/*[contains(@class,' pr-d/groupchoice ')]">
+ <xsl:call-template name="dogroup"/>
+</xsl:template>
+
+<xsl:template match="*[contains(@class,' pr-d/groupseq ')]/*[contains(@class,' pr-d/groupseq ')]">
+ <xsl:call-template name="dogroup"/>
+</xsl:template>
+
+<xsl:template match="*[contains(@class,' pr-d/groupchoice ')]/*[contains(@class,' pr-d/groupcomp ')]">
+ <xsl:call-template name="dogroup"/>
+</xsl:template>
+<xsl:template match="*[contains(@class,' pr-d/groupchoice ')]/*[contains(@class,' pr-d/groupseq ')]">
+ <xsl:call-template name="dogroup"/>
+</xsl:template>
+
+<xsl:template match="*[contains(@class,' pr-d/groupcomp ')]/*[contains(@class,' pr-d/groupchoice ')]">
+ <xsl:call-template name="dogroup"/>
+</xsl:template>
+
+<xsl:template match="*[contains(@class,' pr-d/groupcomp ')]/*[contains(@class,' pr-d/groupseq ')]">
+ <xsl:call-template name="dogroup"/>
+</xsl:template>
+
+<xsl:template match="*[contains(@class,' pr-d/groupseq ')]/*[contains(@class,' pr-d/groupchoice ')]">
+ <xsl:call-template name="dogroup"/>
+</xsl:template>
+
+<xsl:template match="*[contains(@class,' pr-d/groupseq ')]/*[contains(@class,' pr-d/groupcomp ')]">
+ <xsl:call-template name="dogroup"/>
+</xsl:template>
+
+<xsl:template name="dogroup">
+ <xsl:if test="parent::*[contains(@class,' pr-d/groupchoice ')]">
+ <xsl:if test="count(preceding-sibling::*)!=0"> | </xsl:if>
+ </xsl:if>
+ <xsl:if test="@importance='optional'">[</xsl:if>
+ <xsl:if test="name()='groupchoice'">{</xsl:if>
+ <xsl:text> </xsl:text><xsl:apply-templates/><xsl:text> </xsl:text>
+<!-- repid processed here before -->
+ <xsl:if test="name()='groupchoice'">}</xsl:if>
+ <xsl:if test="@importance='optional'">]</xsl:if>
+</xsl:template>
+
+<xsl:template match="*[contains(@class,' pr-d/groupcomp ')]/title|*[contains(@class,' pr-d/groupseq ')]/title|*[contains(@class,' pr-d/groupseq ')]/title"/> <!-- Consume title -->
+
+
+<!-- start of software domain elements -->
+
+<xsl:template match="*[contains(@class,' sw-d/msgph ')]">
+ <fo:inline font-family="Courier">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+
+<xsl:template match="*[contains(@class,' sw-d/msgblock ')]">
+ <xsl:if test="contains(@frame,'top')"><hr /></xsl:if>
+ <xsl:call-template name="gen-att-label"/>
+ <fo:block> <!-- use pre style -->
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:if test="@scale">
+ <!--xsl:attribute name="style">font-size: <xsl:value-of select="@scale"/>%;</xsl:attribute-->
+ </xsl:if>
+ <xsl:apply-templates/>
+ </fo:block>
+ <xsl:if test="contains(@frame,'bot')"><hr /></xsl:if>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' sw-d/msgnum ')]">
+ <fo:inline>
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' sw-d/cmdname ')]">
+ <fo:inline>
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' sw-d/varname ')]">
+ <fo:inline font-style="italic">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' sw-d/filepath ')]">
+ <fo:inline font-family="Courier">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' sw-d/userinput ')]">
+ <fo:inline font-family="Courier">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+<xsl:template match="*[contains(@class,' sw-d/systemoutput ')]">
+ <fo:inline font-family="Courier">
+ <xsl:call-template name="setclass"/>
+ <xsl:apply-templates select="@id"/>
+ <xsl:call-template name="apply-for-phrases"/>
+ </fo:inline>
+</xsl:template>
+
+
+</xsl:transform>
+
Propchange: db/derby/docs/trunk/lib/domains2fo.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: db/derby/docs/trunk/lib/topic2fo-shell.xsl
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/lib/topic2fo-shell.xsl?view=auto&rev=440981
==============================================================================
--- db/derby/docs/trunk/lib/topic2fo-shell.xsl (added)
+++ db/derby/docs/trunk/lib/topic2fo-shell.xsl Wed Sep 6 22:38:10 2006
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved. -->
+
+<!-- faq_shell2fo.xsl
+ | DITA domains support for the demo set; extend as needed
+
+ *-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:import href="xslfo/topic2foImpl.xsl"/>
+<xsl:import href="xslfo/domains2fo.xsl"/>
+
+<xsl:output
+ method="xml"
+ encoding="utf-8"
+/>
+
+<!-- =============== start of override tweaks ============== -->
+
+
+</xsl:stylesheet>
Propchange: db/derby/docs/trunk/lib/topic2fo-shell.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: db/derby/docs/trunk/lib/topic2foImpl.xsl
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/lib/topic2foImpl.xsl?view=auto&rev=440981
==============================================================================
--- db/derby/docs/trunk/lib/topic2foImpl.xsl (added)
+++ db/derby/docs/trunk/lib/topic2foImpl.xsl Wed Sep 6 22:38:10 2006
@@ -0,0 +1,404 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved. -->
+
+<!-- topic2fo.xsl
+ | DITA topic to FO; "single topic to single printed 'chapter'"-level view
+ *-->
+
+<!-- BUGS:
+1. Excluded footnotes still get generated as endnotes.
+ Footnotes located within required cleanup will be rendered whether the doc is output in draft mode or not.
+ This is due to pull-based processing of endnotes, which gets content that would ordinarily be excluded by
+ particular processing settings. This is actually a general problem faced by ANY XSLT processor that
+ has pull-based processors intermingled with push-based exclusion logic. Ideally, exclusion should remove
+ an element from the DOM, then you can depend on pull not to find things it shouldn't find! Two-passes!
+
+ |Bugs:
+ | FO processors are anything but interoperable at the time of this
+ | release of the DITA FO demo (August 2002). There are possibly
+ | other things to work on as well for this FO implementation, but
+ | we know about these:
+ |
+ | - this *demo application* has not been fully localization-enabled
+ | - something causes a page overflow error with XEP
+ | - column numbers do not total correctly for FOP (collapses some tables
+ | to the left, although others do appear to work okay)
+ | - "inherit" as an indent value does not work for FOP
+ | - white-space-collapse="false" is provided as an FOP equivalent to
+ | white-space="pre" but doesn't appear to work
+ | - leader-patter="use-content" is ignored by FOP
+ | - FOP starts a blank initial page; AH does not. layout defs may be the cause
+ | - Antenna House requires changing the "dflt-ext" variable to ".jpg"
+ | (and you must have equivalent graphics in the JPEG format)
+ | - the new simpletable element currently spreads evenly across the number of
+ | defined entries; it has a @relativecols attribute to use for future
+ | methods of passing relative widths to its processor (possibly "* * 3*")
+ | - can't get left indent into "lq" so using surround box instead for now
+ |
+ + added start-indent="2pt" into table-cell procs to eliminate deep offsets w/in cells
+ |
+ +-->
+
+<!DOCTYPE xsl:transform [
+<!-- entities for use in the generated output (must produce correctly in FO) -->
+ <!ENTITY gt ">">
+ <!ENTITY lt "<">
+ <!ENTITY rbl " ">
+ <!ENTITY nbsp " ">
+ <!ENTITY quot """>
+ <!ENTITY quotedblleft "“">
+ <!ENTITY quotedblright "”">
+ <!ENTITY bullet "•"><!--check these two for better assignments -->
+ <!ENTITY middot "‣">
+
+ <!ENTITY section "§">
+ <!ENTITY endash "–">
+ <!ENTITY emdash "—">
+
+ <!ENTITY copyr "©">
+ <!ENTITY trademark "™">
+ <!ENTITY registered "®">
+]>
+<xsl:transform version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:saxon="http://icl.com/saxon" extension-element-prefixes="saxon">
+ <!-- Page setup - used by simple-master-set -->
+ <xsl:param name="paper.type" select="'A4'"/>
+ <xsl:param name="page.orientation" select="'portrait'"/>
+ <xsl:param name="page.margin.bottom" select="'0cm'"/>
+ <xsl:param name="page.margin.top" select="'0cm'"/>
+ <xsl:param name="page.margin.inner">2cm</xsl:param>
+ <xsl:param name="page.margin.outer">2cm</xsl:param>
+ <xsl:param name="body.margin.bottom" select="'2cm'"/>
+ <xsl:param name="body.margin.top" select="'2cm'"/>
+ <xsl:param name="body.font.family" select="'Helvetica'"/>
+ <xsl:param name="body.font.size">9pt</xsl:param>
+ <xsl:include href="dita-page-setup.xsl"/>
+ <!-- Whitespace stripping policy -->
+ <xsl:strip-space elements="*"/>
+ <xsl:preserve-space elements="pre lines"/>
+ <!-- this XSL directive insensitive to DITA specialized elements -->
+ <!-- Here we define default block properties. -->
+ <xsl:attribute-set name="block.properties">
+ <xsl:attribute name="border-bottom-width">0.5em</xsl:attribute>
+ </xsl:attribute-set>
+ <!-- Newline character (capture the native file newline) -->
+ <xsl:variable name="newline"/>
+ <!--null out things that don't apply to PDF -->
+ <xsl:template match="*[contains(@class,' topic/prolog ')]"/>
+ <!-- OTHER STYLESHEET INCLUDES/IMPORTS -->
+ <!-- local, output-specific routines -->
+ <xsl:include href="dita2fo-parms.xsl"/>
+ <!--xsl:include href="dita2fo-prolog.xsl"/-->
+ <xsl:include href="dita2fo-titles.xsl"/>
+ <xsl:include href="dita2fo-elems.xsl"/>
+ <xsl:include href="dita2fo-lists.xsl"/>
+ <xsl:include href="dita2fo-links.xsl"/>
+ <xsl:include href="dita2fo-simpletable.xsl"/>
+ <xsl:include href="dita2fo-calstable.xsl"/>
+ <xsl:include href="dita2fo-subroutines.xsl"/>
+ <!-- common routines -->
+ <xsl:include href="../common/output-message.xsl"/>
+ <xsl:include href="../common/dita-utilities.xsl"/>
+ <!-- null some things that won't be used for now -->
+ <!--xsl:template name="output-message"/-->
+ <!--
+ <xsl:include href="dita2fo-stubs.xsl"/>
+ <xsl:include href="toc2fo.xsl"/>
+-->
+ <!-- OUTPUT METHOD -->
+ <!-- Should this be specified in the including shell? -->
+ <!-- XSLFO output is simple XML syntax) -->
+ <xsl:output method="xml" version="1.0"/>
+ <!-- USER SPECIFIC DECLARED VALUES (declared in dit2fo-parms.xsl) -->
+ <!-- "GLOBAL" DECLARATIONS -->
+ <!-- Setup for translation/localization (declared in dit2fo-parms.xsl -->
+ <!-- ROOT RULE -->
+ <xsl:template match="/" priority="3">
+ <xsl:apply-templates mode="toplevel"/>
+ </xsl:template>
+ <!-- This first template rule generates the outer-level shell for a delivery context. -->
+ <!-- In an override stylesheet, the same call to "chapter-setup" must be issued to
+ maintain the consistency of overall look'n'feel of the output FO. -->
+ <xsl:template match="*[contains(@class,' topic/topic ')]" name="toptopic" mode="toplevel">
+ <!-- this is an "h1div" context for standalone documents -->
+ <xsl:call-template name="chapter-setup"/>
+ </xsl:template>
+ <!-- =============== start of contextual topic titles ================= -->
+ <!-- this should be a lower-priority match for all non-toplevel topics in an aggregate -->
+ <xsl:template match="*[contains(@class,' topic/topic ')]">
+ <fo:block>
+ <!-- delete the line which call "gen-toc-id" template to fix bug#1304859 -->
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template>
+ <!-- =================== start of processors ====================== -->
+ <!-- SCRIPT SUPPORT -->
+ <xsl:template name="script-sample">
+ <!-- not applicable for FO output -->
+ </xsl:template>
+ <!-- NAMED TEMPLATES (call by name, only) -->
+ <xsl:template name="gen-att-label">
+ <xsl:if test="@spectitle">
+ <fo:block font-weight="bold">
+ <xsl:value-of select="@spectitle"/>
+ </fo:block>
+ </xsl:if>
+ </xsl:template>
+ <!-- named templates that can be used anywhere -->
+ <!-- this replaces newlines with the BR element, forcing non-concatenation even in flow contexts -->
+ <xsl:template name="br-replace">
+ <xsl:param name="word"/>
+ <!-- capture an actual newline within the xsl:text element -->
+ <xsl:variable name="cr">
+ <xsl:text/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($word,$cr)">
+ <xsl:value-of select="substring-before($word,$cr)"/>
+ <!--br class="br"/-->
+ <xsl:call-template name="br-replace">
+ <xsl:with-param name="word" select="substring-after($word,$cr)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$word"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- diagnostic: call this to generate a path-like view of an element's ancestry! -->
+ <xsl:template name="breadcrumbs">
+ <xsl:variable name="full-path">
+ <xsl:for-each select="ancestor-or-self::*">
+ <xsl:value-of select="concat('/',name())"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <fo:block font-weight="bold">
+ <xsl:value-of select="$full-path"/>
+ </fo:block>
+ </xsl:template>
+ <!-- the following named templates generate inline content for the delivery context -->
+ <!-- generate null filler if the phrase is evidently empty -->
+ <xsl:template name="apply-for-phrases">
+ <xsl:choose>
+ <xsl:when test="not(text()[normalize-space(.)] | *)">
+ <!--xsl:comment>null</xsl:comment-->
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- "FORMAT" GLOBAL DECLARATIONS -->
+ <xsl:variable name="fmt-fig-lbl-loc">over</xsl:variable>
+ <!-- values: over, under -->
+ <xsl:variable name="fmt-tbl-lbl-loc">over</xsl:variable>
+ <!-- values: over, under -->
+ <xsl:variable name="link-top-section">no</xsl:variable>
+ <!-- values: yes, no (or any not "yes") -->
+ <xsl:variable name="do-place-ing">no</xsl:variable>
+ <!-- values: yes, no (or any not "yes") -->
+ <!-- this value should be created in a named template since it needs to increment per call -->
+ <!-- for now, the static value is null until we can redo this intent -->
+ <xsl:variable name="fig-pfx-txt"/>
+ <xsl:variable name="xfig-pfx-txt">
+ <xsl:call-template name="getString">
+ <xsl:with-param name="stringName" select="'Figure'"/>
+ </xsl:call-template>
+ <xsl:number level="any" count="label" from="/"/> of <xsl:value-of
+ select="count(//fig/label)"/>. </xsl:variable>
+ <!-- values: '' or custom design -->
+ <xsl:variable name="tbl-pfx-txt"/>
+ <!-- "FORMAT" MACROS -->
+ <!--
+ | These macros support globally-defined formatting constants for
+ | document content. Some elements have attributes that permit local
+ | control of formatting; such logic is part of the pertinent template rule.
+ +-->
+ <xsl:template name="place-tbl-width">
+ <xsl:variable name="twidth-fixed">100%</xsl:variable>
+ <xsl:if test="$twidth-fixed != ''">
+ <xsl:attribute name="width">
+ <xsl:value-of select="$twidth-fixed"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="proc-ing">
+ <xsl:if test="$do-place-ing = 'yes'">
+ <!-- set in a global variable, as with label placement, etc. -->
+ <fo:external-graphic src="url(image/tip-ing.jpg)"/>
+ <!-- this should be an xsl:choose with the approved list and a selection method-->
+
+ <!-- add any other required positioning controls, if needed, but must be valid in the location
+ from which the call to this template was made -->
+ </xsl:if>
+ </xsl:template>
+ <!-- =================== end of processors ====================== -->
+ <!-- =================== start of override stubs ====================== -->
+ <!-- STUBS FOR USER PROVIDED OVERRIDE EXTENSIONS -->
+ <xsl:template name="gen-user-header">
+ <!-- to customize: copy this to your override transform, add whatever content you want! -->
+ <!-- for example, to display logos, search/nav widgets, etc. -->
+ </xsl:template>
+ <xsl:template name="gen-user-footer">
+ <!-- to customize: copy this to your override transform, add whatever content you want! -->
+ <!-- for example, to display compliances for: XHTML, accessibility, content ratings, etc. -->
+ </xsl:template>
+ <xsl:template name="gen-user-sidetoc">
+ <!-- to customize: copy this to your override transform, add whatever content you want! -->
+ <!-- Common implementations use a table with align=right to place generated content
+ adjacent to the start of the body content -->
+ </xsl:template>
+ <xsl:template name="gen-user-scripts">
+ <!-- to customize: copy this to your override transform, add whatever content you want! -->
+ <!-- see (or enable) the named template "script-sample" for an example -->
+ <!--xsl:call-template name="script-sample"/-->
+ </xsl:template>
+ <xsl:template name="gen-user-styles">
+ <!-- to customize: copy this to your override transform, add whatever content you want! -->
+ </xsl:template>
+ <xsl:template name="gen-user-panel-title-pfx">
+ <!-- to customize: copy this to your override transform, add whatever content you want! -->
+ <!-- Generate content based on run-time parameter value, with local logic here -->
+ <!-- This is overrideable -->
+ </xsl:template>
+ <xsl:template name="gen-main-panel-title">
+ <!-- use the searchtitle unless there's no value - else use title -->
+ <xsl:variable name="schtitle">
+ <xsl:value-of select="/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/titlealts ')]/*[contains(@class,' topic/searchtitle ')]"/>
+ </xsl:variable>
+ <xsl:variable name="ditaschtitle">
+ <xsl:value-of select="/dita/*[contains(@class,' topic/topic ')][1]/*[contains(@class,' topic/titlealts ')]/*[contains(@class,' topic/searchtitle ')]"/>
+ </xsl:variable>
+ <xsl:variable name="maintitle">
+ <xsl:value-of select="/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]"/>
+ </xsl:variable>
+ <xsl:variable name="ditamaintitle">
+ <xsl:value-of select="/dita/*[contains(@class,' topic/topic ')][1]/*[contains(@class,' topic/title ')]"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="string-length($schtitle)>'0'">
+ <xsl:value-of select="$schtitle"/>
+ </xsl:when>
+ <xsl:when test="string-length($ditaschtitle)>'0'">
+ <xsl:value-of select="$ditaschtitle"/>
+ </xsl:when>
+ <xsl:when test="string-length($maintitle)>'0'">
+ <xsl:value-of select="$maintitle"/>
+ </xsl:when>
+ <xsl:when test="string-length($ditamaintitle)>'0'">
+ <xsl:value-of select="$ditamaintitle"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>***</xsl:text>
+ <xsl:call-template name="output-message">
+ <xsl:with-param name="msg">No title specified; using "***".</xsl:with-param>
+ <xsl:with-param name="msgnum">009</xsl:with-param>
+ <xsl:with-param name="msgsev">W</xsl:with-param>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="gen-user-metadata"/>
+ <!-- not applicable yet within FO -->
+ <!-- =================== end of override stubs ====================== -->
+ <!-- =================== DEFAULT PAGE LAYOUT ====================== -->
+ <xsl:template name="chapter-setup">
+ <!-- Newline character (capture the native file newline) -->
+ <xsl:variable name="newline"/>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="cover" page-height="792pt"
+ page-width="612pt" margin-top="36pt" margin-bottom="36pt"
+ margin-left="36pt" margin-right="36pt">
+ <fo:region-body margin-top="120pt"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="leftPage" page-height="792pt"
+ page-width="612pt" margin-top="36pt" margin-bottom="36pt"
+ margin-left="72pt" margin-right="60pt">
+ <fo:region-body margin-bottom="36pt" margin-top="24pt"/>
+ <fo:region-before extent="24pt"/>
+ <fo:region-after extent="36pt"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="rightPage" page-height="792pt"
+ page-width="612pt" margin-top="36pt" margin-bottom="36pt"
+ margin-left="60pt" margin-right="72pt">
+ <fo:region-body margin-bottom="36pt" margin-top="24pt"/>
+ <fo:region-before extent="24pt"/>
+ <fo:region-after extent="36pt"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="common-page" page-height="792pt"
+ page-width="612pt" margin-top="36pt" margin-bottom="36pt"
+ margin-left="60pt" margin-right="60pt">
+ <fo:region-body margin-bottom="36pt" margin-top="24pt"/>
+ <fo:region-before extent="24pt"/>
+ <fo:region-after extent="36pt"/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <!--xsl:call-template name="gen-cover-page"-->
+ <!-- initiate content processing within basic page "shell" -->
+ <fo:page-sequence master-reference="common-page" force-page-count="no-force">
+ <!-- header -->
+ <fo:static-content flow-name="xsl-region-before" font-size="9pt" font-family="Helvetica">
+ <fo:block linefeed-treatment="ignore" text-align-last="justify">
+ <fo:inline text-align="start">
+ <xsl:text>Stub for header content</xsl:text>
+ </fo:inline>
+ <!-- remove use-content for FOP -->
+ <!--<fo:leader rule-style="solid" leader-length.maximum="100%" leader-length.optimum="60%" leader-length.minimum="10pt" leader-pattern="use-content"> </fo:leader>-->
+ <fo:leader rule-style="solid" leader-length.maximum="100%"
+ leader-length.optimum="60%" leader-length.minimum="10pt"> </fo:leader>
+ <fo:inline text-align="end" font-weight="bold">
+ <xsl:text>right side content</xsl:text>
+ </fo:inline>
+ </fo:block>
+ <!--fo:block><fo:leader leader-pattern="rule" leader-length="100%"/></fo:block-->
+ </fo:static-content>
+ <!-- footer -->
+ <fo:static-content flow-name="xsl-region-after">
+ <fo:block linefeed-treatment="ignore" text-align-last="justify">
+ <fo:inline text-align="start" font-size="10pt" font-family="Helvetica">
+ <xsl:value-of select="//*/*[contains(@class, ' topic/title ')]"/>
+ </fo:inline>
+ <!--fo:leader rule-style="solid" leader-length.maximum="100%" leader-length.optimum="60%" leader-length.minimum="10pt" leader-pattern="use-content"> </fo:leader-->
+ <fo:inline text-align="end" font-size="10pt" font-weight="bold" font-family="Helvetica">
+ <xsl:text>Page </xsl:text>
+ <fo:page-number/>
+ </fo:inline>
+ </fo:block>
+ </fo:static-content>
+ <!-- body -->
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block line-height="10pt" font-size="9pt" font-family="Helvetica" id="page1-1">
+ <xsl:apply-templates/>
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </xsl:template>
+ <xsl:template name="gen-cover-page">
+ <!-- generate an "outside-front cover" page -->
+ <fo:page-sequence master-reference="cover">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block text-align="center">
+ <fo:block space-after.optimum="40pt" space-before.optimum="40pt"
+ line-height="80pt" font-size="32pt" font-family="Helvetica">
+ <xsl:value-of select="/topic/title"/>
+ </fo:block>
+ <fo:block line-height="50pt" font-size="24pt" font-family="Helvetica">
+ <fo:block font-style="italic">
+ <xsl:value-of select="*[contains(@class, ' topic/title ')]"/>
+ </fo:block>
+ </fo:block>
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ <!-- generate an "inside front cover" page (left side) -->
+ <fo:page-sequence master-reference="cover">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block xsl:use-attribute-sets="p" color="purple" text-align="center"/>
+ </fo:flow>
+ </fo:page-sequence>
+ </xsl:template>
+ <!-- domains (should be external) -->
+</xsl:transform>
Propchange: db/derby/docs/trunk/lib/topic2foImpl.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Added: db/derby/docs/trunk/lib/topicmerge.xsl
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/lib/topicmerge.xsl?view=auto&rev=440981
==============================================================================
--- db/derby/docs/trunk/lib/topicmerge.xsl (added)
+++ db/derby/docs/trunk/lib/topicmerge.xsl Wed Sep 6 22:38:10 2006
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved. -->
+
+<!-- book.xsl
+ | Merge DITA topics with "validation" of topic property
+ *-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<!-- Include error message template -->
+<xsl:include href="common/output-message.xsl"/>
+
+<xsl:param name="root-path"></xsl:param>
+
+<!-- Set the prefix for error message numbers -->
+<xsl:variable name="msgprefix">IDXS</xsl:variable>
+
+<xsl:variable name="xml-path"></xsl:variable>
+
+<xsl:output method="xml"
+ encoding="utf-8"
+/>
+
+<xsl:template match="/*">
+ <xsl:element name="{name()}">
+ <xsl:apply-templates select="@*" mode="copy-element"/>
+ <xsl:apply-templates select="*"/>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template match="/*/*[contains(@class,' map/topicmeta ')]" priority="1">
+ <xsl:apply-templates select="." mode="copy-element"/>
+</xsl:template>
+<xsl:template match="*[contains(@class,' map/topicmeta ')]"/>
+<xsl:template match="*[contains(@class,' map/navref ')]"/>
+<xsl:template match="*[contains(@class,' map/reltable ')]"/>
+<xsl:template match="*[contains(@class,' map/anchor ')]"/>
+
+<xsl:template match="*[contains(@class,' map/topicref ')][@href][not(@href='')][not(@print='no')]">
+ <xsl:variable name="topicrefClass"><xsl:value-of select="@class"/></xsl:variable>
+ <xsl:comment>Start of imbed for <xsl:value-of select="@href"/></xsl:comment>
+ <xsl:choose>
+ <xsl:when test="@format and not(@format='dita')">
+ <!-- Topicref to non-dita files will be ingored in PDF transformation -->
+ <xsl:call-template name="output-message">
+ <xsl:with-param name="msg">Topicref to non-dita files will be ignored in PDF transformation</xsl:with-param>
+ <xsl:with-param name="msgnum">039</xsl:with-param>
+ <xsl:with-param name="msgsev">I</xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains(@href,'#')">
+ <xsl:variable name="sourcefile"><xsl:value-of select="substring-before(@href,'#')"/></xsl:variable>
+ <xsl:variable name="sourcetopic"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
+ <xsl:variable name="targetName"><xsl:value-of select="name(document($sourcefile,/)//*[@id=$sourcetopic][contains(@class,' topic/topic ')][1])"/></xsl:variable>
+ <xsl:element name="{$targetName}">
+ <xsl:apply-templates select="document($sourcefile,/)//*[@id=$sourcetopic][contains(@class,' topic/topic ')][1]/@*" mode="copy-element"/>
+ <xsl:attribute name="refclass"><xsl:value-of select="$topicrefClass"/></xsl:attribute>
+ <xsl:apply-templates select="document($sourcefile,/)//*[@id=$sourcetopic][contains(@class,' topic/topic ')][1]/*" mode="copy-element">
+ <xsl:with-param name="src-file"><xsl:value-of select="$sourcefile"/></xsl:with-param>
+ </xsl:apply-templates>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:when>
+ <!-- If the target is a topic, as opposed to a ditabase mixed file -->
+ <xsl:when test="document(@href,/)/*[contains(@class,' topic/topic ')]">
+ <xsl:variable name="targetName"><xsl:value-of select="name(document(@href,/)/*)"/></xsl:variable>
+ <xsl:element name="{$targetName}">
+ <xsl:apply-templates select="document(@href,/)/*/@*" mode="copy-element"/>
+ <xsl:attribute name="refclass"><xsl:value-of select="$topicrefClass"/></xsl:attribute>
+ <!-- If the root element of the topic does not contain an id attribute, then generate one.
+ Later, we will use these id attributes as anchors for PDF bookmarks. -->
+ <xsl:if test="not(document(@href,/)/*/@id)">
+ <xsl:attribute name="id"><xsl:value-of select="generate-id()"/></xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="document(@href,/)/*/*" mode="copy-element">
+ <xsl:with-param name="src-file"><xsl:value-of select="@href"/></xsl:with-param>
+ </xsl:apply-templates>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:when>
+ <!-- Otherwise: pointing to ditabase container; output each topic in the ditabase file.
+ The refclass value is copied to each of the main topics.
+ If this topicref has children, they will be treated as children of the <dita> wrapper.
+ This is the same as saving them as peers of the topics in the ditabase file. -->
+ <xsl:otherwise>
+ <xsl:for-each select="document(@href,/)/*/*">
+ <xsl:element name="{name()}">
+ <xsl:apply-templates select="@*" mode="copy-element"/>
+ <xsl:attribute name="refclass"><xsl:value-of select="$topicrefClass"/></xsl:attribute>
+ <xsl:apply-templates select="*" mode="copy-element"/>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="*[contains(@class,' map/topicref ')][not(@href)]">
+ <xsl:element name="{name()}">
+ <xsl:apply-templates select="@*" mode="copy-element"/>
+ <xsl:apply-templates/>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template match="*|@*|comment()|processing-instruction()|text()" mode="copy-element">
+<xsl:param name="src-file"></xsl:param>
+ <xsl:copy>
+ <xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()" mode="copy-element">
+ <xsl:with-param name="src-file"><xsl:value-of select="$src-file"/></xsl:with-param>
+ </xsl:apply-templates>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="@href" mode="copy-element" priority="1">
+ <xsl:param name="src-file"></xsl:param>
+
+ <xsl:variable name="file-path">
+ <xsl:call-template name="get-file-path">
+ <xsl:with-param name="src-file">
+ <xsl:value-of select="$src-file"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:value-of select="."/>
+ </xsl:variable>
+
+ <xsl:variable name="file-path-new">
+ <xsl:call-template name="normalize-path">
+ <xsl:with-param name="file-path">
+ <xsl:value-of select="$file-path"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="contains(.,'://') or starts-with(.,'#')">
+ <xsl:copy/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="href">
+ <xsl:value-of select="$file-path-new"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="get-file-path">
+ <xsl:param name="src-file"/>
+ <xsl:if test="contains($src-file,'/')">
+ <xsl:value-of select="substring-before($src-file,'/')"/>
+ <xsl:text>/</xsl:text>
+ <xsl:call-template name="get-file-path">
+ <xsl:with-param name="src-file">
+ <xsl:value-of select="substring-after($src-file,'/')"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template name="normalize-path">
+ <xsl:param name="file-path"></xsl:param>
+
+ <xsl:choose>
+ <xsl:when test="contains($file-path, '/')">
+ <xsl:variable name="dirname" select="substring-before($file-path,'/')"/>
+ <xsl:variable name="file-path-new" select="substring-after($file-path,'/')"/>
+ <xsl:variable name="dirname2" select="substring-before($file-path-new,'/')"/>
+ <xsl:variable name="file-path-new2" select="substring-after($file-path-new,'/')"/>
+
+ <xsl:choose>
+ <xsl:when test="$dirname2='..'">
+ <xsl:choose>
+ <xsl:when test="$dirname='..'">
+ <xsl:text>../../</xsl:text>
+ <xsl:call-template name="normalize-path">
+ <xsl:with-param name="file-path">
+ <xsl:value-of select="$file-path-new2"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="normalize-path">
+ <xsl:with-param name="file-path">
+ <xsl:value-of select="$file-path-new2"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$dirname"/><xsl:text>/</xsl:text>
+ <xsl:call-template name="normalize-path">
+ <xsl:with-param name="file-path">
+ <xsl:value-of select="$file-path-new"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$file-path">
+ <xsl:value-of select="$file-path"/>
+ </xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
Propchange: db/derby/docs/trunk/lib/topicmerge.xsl
------------------------------------------------------------------------------
svn:eol-style = native