From 29d5b8b4d4e33fbd56ba60c4d7cb28e775c1d4f0 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Thu, 13 Jul 2006 08:13:48 +0000 Subject: INTEGRATION: CWS latex (1.7.74); FILE MERGED 2006/04/07 10:23:28 sus 1.7.74.1: #i16350# Added patch for Example and programlisting handling in docbook --- filter/source/docbook/docbooktosoffheadings.xsl | 162 +++++++++++++----------- filter/source/docbook/sofftodocbookheadings.xsl | 115 ++++++++++------- 2 files changed, 155 insertions(+), 122 deletions(-) (limited to 'filter/source/docbook') diff --git a/filter/source/docbook/docbooktosoffheadings.xsl b/filter/source/docbook/docbooktosoffheadings.xsl index 76d2a1cd421a..cb83a4b0ab12 100644 --- a/filter/source/docbook/docbooktosoffheadings.xsl +++ b/filter/source/docbook/docbooktosoffheadings.xsl @@ -1,36 +1,36 @@ @@ -79,7 +79,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - + @@ -91,7 +91,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - + @@ -106,7 +106,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - + Section SubTitle @@ -135,13 +135,13 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - + - - - + + + - Appendix Title + Appendix Title @@ -168,7 +168,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - + @@ -177,7 +177,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. Appendix - + @@ -226,7 +226,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string articleinfo.subtitle @@ -236,7 +236,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string articleinfo.subtitle @@ -250,7 +250,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string articleinfo.edition @@ -260,7 +260,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string articleinfo.edition @@ -274,7 +274,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string articleinfo.releaseinfo_ @@ -284,7 +284,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string articleinfo.releaseinfo_ @@ -299,9 +299,9 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string - + articleinfo.author_.firstname_ @@ -312,7 +312,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string @@ -330,9 +330,9 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string - + articleinfo.copyright_.year_ @@ -343,7 +343,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string @@ -363,9 +363,9 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string - + articleinfo.copyright_.holder_ @@ -376,7 +376,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string @@ -399,7 +399,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string articleinfo.author_.affiliation_.address_ @@ -409,7 +409,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string articleinfo.author_.affiliation_.address_ @@ -424,7 +424,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string @@ -436,14 +436,14 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string articleinfo.author_.affiliation_.orgname_ - + @@ -454,9 +454,9 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string - + articleinfo.author_.surname_ @@ -465,12 +465,12 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - string + string articleinfo.author_.surname_ - + @@ -513,22 +513,22 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - + - - + + - 1 + 1 abstract @@ -537,7 +537,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - 1 + 1 appendix @@ -546,46 +546,46 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. 1 - + - 2 - + 2 + - 3 - + 3 + - 4 - + 4 + - 5 - + 5 + @@ -709,7 +709,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - + --> @@ -764,13 +764,13 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. Ordered List false - + - + VarList Term @@ -926,8 +926,8 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. 1cm - - + + 1cm @@ -940,7 +940,7 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. <All formats> - + @@ -1034,8 +1034,8 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. 1cm - - + + 1cm @@ -1069,8 +1069,8 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. 1cm - - + + 1cm @@ -1114,6 +1114,14 @@ xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice. - + + + + + Example + + + + diff --git a/filter/source/docbook/sofftodocbookheadings.xsl b/filter/source/docbook/sofftodocbookheadings.xsl index abc42f2533e3..2fd98f58ed1b 100644 --- a/filter/source/docbook/sofftodocbookheadings.xsl +++ b/filter/source/docbook/sofftodocbookheadings.xsl @@ -1,37 +1,37 @@ - @@ -68,7 +68,7 @@ --> - + @@ -94,7 +94,7 @@ </sect> - + <sect> @@ -190,7 +190,7 @@ </releaseinfo> </xsl:for-each> <xsl:call-template name="ArticleInfo"><xsl:with-param name="level" select="0"/></xsl:call-template> - + </articleinfo> </xsl:when> <xsl:when test="@text:name='Abstract'"> @@ -204,7 +204,7 @@ </appendix> </xsl:when> <xsl:otherwise> - <xsl:variable name="sectvar"><xsl:text>sect</xsl:text><xsl:value-of select="count(ancestor::text:section)+1"/></xsl:variable> + <xsl:variable name="sectvar"><xsl:text>sect</xsl:text><xsl:value-of select="count(ancestor::text:section)+1"/></xsl:variable> <xsl:variable name="idvar"><xsl:text> id="</xsl:text><xsl:value-of select="@text:name"/><xsl:text>"</xsl:text></xsl:variable> <xsl:text disable-output-escaping="yes"><</xsl:text><xsl:value-of select="$sectvar"/><xsl:value-of select="$idvar"/><xsl:text disable-output-escaping="yes">></xsl:text> <xsl:apply-templates/> @@ -220,15 +220,15 @@ <xsl:variable name="author"><xsl:value-of select="concat('articleinfo.author_','', $level)"/></xsl:variable> <xsl:if test="text:p/text:variable-set[contains(@text:name, $author )]"> <xsl:call-template name="Author"><xsl:with-param name="AuthorLevel" select="0"/></xsl:call-template> - <xsl:call-template name="Copyright"><xsl:with-param name="CopyrightLevel" select="0"/></xsl:call-template> - </xsl:if> + <xsl:call-template name="Copyright"><xsl:with-param name="CopyrightLevel" select="0"/></xsl:call-template> + </xsl:if> </xsl:template> <xsl:template name="Copyright"> <xsl:param name="CopyrightLevel"/> - + <xsl:variable name="Copyright"><xsl:value-of select="concat('articleinfo.copyright_','', $CopyrightLevel)"/></xsl:variable> - + <xsl:if test="text:p/text:variable-set[contains(@text:name,$Copyright)]"> <copyright> <xsl:call-template name="Year"> @@ -276,7 +276,7 @@ <xsl:template name="Author"> <xsl:param name="AuthorLevel"/> - <xsl:variable name="Author"><xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/></xsl:variable> + <xsl:variable name="Author"><xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/></xsl:variable> <xsl:if test="text:p/text:variable-set[contains(@text:name, $Author )]"> <author> <xsl:call-template name="Surname"><xsl:with-param name="AuthorLevel" select="$AuthorLevel"/><xsl:with-param name="SurnameLevel" select="0"/></xsl:call-template> @@ -284,7 +284,7 @@ <xsl:call-template name="Affiliation"><xsl:with-param name="AuthorLevel" select="$AuthorLevel"/><xsl:with-param name="AffilLevel" select="0"/></xsl:call-template> </author> <xsl:call-template name="Author"><xsl:with-param name="AuthorLevel" select="$AuthorLevel+1"/></xsl:call-template> - </xsl:if> + </xsl:if> </xsl:template> @@ -469,7 +469,7 @@ </author> </xsl:template>--> -<xsl:template match="table:table"> +<xsl:template match="table:table"> <xsl:choose> <xsl:when test="following-sibling::text:p[@text:style-name='Table']"> <table frame="all"> @@ -508,7 +508,7 @@ <xsl:element name="tgroup"> <xsl:attribute name="cols"> <xsl:value-of select="$numcols"/> - </xsl:attribute> + </xsl:attribute> <xsl:call-template name="colspec"><xsl:with-param name="left" select="1" /></xsl:call-template> <xsl:apply-templates/> </xsl:element> @@ -536,7 +536,7 @@ <xsl:template match="table:table-header-rows"> <thead> <xsl:apply-templates/> - </thead> + </thead> </xsl:template> <xsl:template match="table:table-header-rows/table:table-row"> @@ -572,7 +572,7 @@ <xsl:when test="@text:style-name='Table'"> </xsl:when> <xsl:otherwise> - <para> + <para> <xsl:apply-templates/> </para> </xsl:otherwise> @@ -601,7 +601,7 @@ <xsl:template match="text:list-item"> <!-- <xsl:if test="parent::text:unordered-list/@text:style-name='Var List'"> - + </xsl:if> <xsl:if test="not(parent::text:unordered-list/@text:style-name='Var List')"> <listitem> @@ -624,7 +624,7 @@ <xsl:apply-templates/> </xsl:element> </xsl:otherwise> - </xsl:choose> + </xsl:choose> </xsl:template> @@ -707,47 +707,47 @@ <xsl:choose> <xsl:when test="./@text:style-name='GuiMenu'"> <xsl:element name="guimenu"> - <xsl:value-of select="."/> + <xsl:value-of select="."/> </xsl:element> </xsl:when> <xsl:when test="./@text:style-name='GuiSubMenu'"> <xsl:element name="guisubmenu"> - <xsl:value-of select="."/> + <xsl:value-of select="."/> </xsl:element> </xsl:when> <xsl:when test="@text:style-name='GuiMenuItem'"> <xsl:element name="guimenuitem"> - <xsl:value-of select="."/> + <xsl:value-of select="."/> </xsl:element> </xsl:when> <xsl:when test="@text:style-name='GuiButton'"> <xsl:element name="guibutton"> - <xsl:value-of select="."/> + <xsl:value-of select="."/> </xsl:element> </xsl:when> <xsl:when test="@text:style-name='GuiButton'"> <xsl:element name="guibutton"> - <xsl:value-of select="."/> + <xsl:value-of select="."/> </xsl:element> </xsl:when> <xsl:when test="@text:style-name='GuiLabel'"> <xsl:element name="guilabel"> - <xsl:value-of select="."/> + <xsl:value-of select="."/> </xsl:element> </xsl:when> <xsl:when test="@text:style-name='Emphasis'"> <xsl:element name="emphasis"> - <xsl:value-of select="."/> + <xsl:value-of select="."/> </xsl:element> </xsl:when> <xsl:when test="@text:style-name='FileName'"> <xsl:element name="filename"> - <xsl:value-of select="."/> + <xsl:value-of select="."/> </xsl:element> </xsl:when> <xsl:when test="@text:style-name='Application'"> <xsl:element name="application"> - <xsl:value-of select="."/> + <xsl:value-of select="."/> </xsl:element> </xsl:when> <xsl:when test="@text:style-name='Command'"> @@ -799,7 +799,7 @@ <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> - + </xsl:template> @@ -813,14 +813,14 @@ <xsl:apply-templates/> </xsl:element> </xsl:when> - <xsl:when test="contains(@xlink:href,'mailto:')"> + <xsl:when test="contains(@xlink:href,'mailto:')"> <xsl:element name="ulink"> - <xsl:attribute name ="url"> - <xsl:value-of select="@xlink:href"/> + <xsl:attribute name ="url"> + <xsl:value-of select="@xlink:href"/> </xsl:attribute> <xsl:apply-templates/> - </xsl:element> - </xsl:when> + </xsl:element> + </xsl:when> <xsl:when test="not(contains(@xlink:href,'#'))"> <xsl:element name="olink"> <xsl:attribute name="targetdocent"> @@ -833,7 +833,7 @@ <xsl:variable name="linkvar" select="substring-after(@xlink:href,'#')"/> <xsl:element name="link"> <xsl:attribute name="linkend"> - <xsl:value-of select="substring-before($linkvar,'%')"/> + <xsl:value-of select="substring-before($linkvar,'%')"/> </xsl:attribute> <xsl:apply-templates/> </xsl:element> @@ -841,5 +841,30 @@ </xsl:choose> </xsl:template> +<!-- + Change Made By Kevin Fowlks (fowlks@msu.edu) July 2nd, 2003 + This allows users to create example code in DocBook. + Note: This type of grouping could also be implemented for + <notes>,<literallayout>, <blockquote> or any other tag that requires text to be treated as blocked. +--> +<xsl:template match="text:p[@text:style-name='Example']"> + <xsl:if test="not(preceding-sibling::*[1][self::text:p[@text:style-name='Example']])"> + <xsl:element name="example"> + <xsl:element name="title"></xsl:element> + <xsl:element name="programlisting"> + <xsl:value-of select="." /> + <xsl:text disable-output-escaping="no"> </xsl:text> + <xsl:apply-templates mode="in-list" + select="following-sibling::*[1][self::text:p[@text:style-name='Example']]" /> + </xsl:element> + </xsl:element> + </xsl:if> +</xsl:template> + +<xsl:template match="text:p[@text:style-name='Example']" mode="in-list"> + <xsl:value-of select="." /> + <xsl:text disable-output-escaping="no"> </xsl:text> + <xsl:apply-templates mode="in-list" select="following-sibling::*[1][self::text:p[@text:style-name='Example']]"/> +</xsl:template> </xsl:stylesheet> -- cgit