From 032e2556d1ad9b0fa8e3fe96b64d13aa27fadd78 Mon Sep 17 00:00:00 2001 From: Aidan Butler Date: Fri, 30 May 2003 14:22:42 +0000 Subject: Initial import of export stylesheet for DocBook chapters --- .../xslt/docbook/sofftodocbookheadings_chapter.xsl | 1081 ++++++++++++++++++++ 1 file changed, 1081 insertions(+) create mode 100644 xmerge/java/org/openoffice/xmerge/converter/xml/xslt/docbook/sofftodocbookheadings_chapter.xsl (limited to 'xmerge') diff --git a/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/docbook/sofftodocbookheadings_chapter.xsl b/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/docbook/sofftodocbookheadings_chapter.xsl new file mode 100644 index 000000000000..244307eb8817 --- /dev/null +++ b/xmerge/java/org/openoffice/xmerge/converter/xml/xslt/docbook/sofftodocbookheadings_chapter.xsl @@ -0,0 +1,1081 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:value-of select="text:p[@text:style-name='Document Title']"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + sect + + + + id=" + + " + + < + + + > + + </ + + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + sect + + + + + + + + <xsl:call-template name="make-section"> + <xsl:with-param name="current" select="$current"/> + <xsl:with-param name="prev" select="$prev +1"/> + </xsl:call-template> + <!--<xsl:text disable-output-escaping="yes"></sect</xsl:text><xsl:value-of select="$prev +1 "/><xsl:text disable-output-escaping="yes">></xsl:text>--> + + </xsl:element> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="sect.element"> + <xsl:text disable-output-escaping="yes">sect</xsl:text> + <xsl:value-of select="$current"/> + </xsl:variable> + <!--<xsl:text disable-output-escaping="yes"><sect</xsl:text><xsl:value-of select="$current"/><xsl:text disable-output-escaping="yes">></xsl:text>--> + + <xsl:element name="{$sect.element}"> + <xsl:call-template name="id.attribute"/> + <title> + <xsl:apply-templates/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <menuchoice> + + + + + + + + + + </menuchoice> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+ + + + + + + + + <xsl:apply-templates/> + + + + + + <xsl:apply-templates/> + + + + + + + <listitem> + + + + + + </listitem> + + + + + + + + + + + + + + <xsl:apply-templates/> + + + + + + + <xsl:apply-templates/> + + + + + + + <xsl:apply-templates/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:value-of select="following-sibling::text:p[@text:style-name='Table']"/> + + +
+
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <tbody> + + + + + + </tbody> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:apply-templates/> + </itemizedlist> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template match="text:list-item"> + <xsl:if test="parent::text:unordered-list/@text:style-name='Var List'"> + <varlistentry> + <xsl:for-each select="text:p[@text:style-name='VarList Term']"> + <xsl:apply-templates select="."/> + </xsl:for-each> + </varlistentry> + </xsl:if> + <xsl:if test="not(parent::text:unordered-list/@text:style-name='Var List')"> + <listitem> + <xsl:apply-templates/> + </listitem> + </xsl:if> + </xsl:template> + + + <xsl:template match="dc:title"/> + + + <xsl:template match="dc:description"> + <abstract> + <para> + <xsl:apply-templates/> + </para> + </abstract> + </xsl:template> + + + <xsl:template match="dc:subject"/> + + <xsl:template match="meta:generator"/> + + <xsl:template match="draw:plugin"> + <xsl:element name="audioobject"> + <xsl:attribute name="fileref"> + <xsl:value-of select="@xlink:href"/> + </xsl:attribute> + <xsl:attribute name="width"/> + </xsl:element> + </xsl:template> + + + <xsl:template match="text:footnote"> + <footnote> + <xsl:apply-templates/> + </footnote> + </xsl:template> + + + <xsl:template match="text:footnote-body"> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="draw:text-box"/> + + <xsl:template match="draw:image"> + <xsl:choose> + <xsl:when test="parent::text:p[@text:style-name='Mediaobject']"> + <xsl:element name="imageobject"> + <xsl:element name="imagedata"> + <xsl:attribute name="fileref"> + <xsl:value-of select="@xlink:href"/> + </xsl:attribute> + </xsl:element> + <xsl:element name="caption"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:when> + <xsl:otherwise> + <xsl:element name="inlinegraphic"> + <xsl:attribute name="fileref"> + <xsl:value-of select="@xlink:href"/> + </xsl:attribute> + <xsl:attribute name="width"/> + </xsl:element> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template match="text:span"> + <xsl:choose> + <xsl:when test="./@text:style-name='GuiMenu'"> + <xsl:element name="guimenu"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:when> + <xsl:when test="./@text:style-name='GuiSubMenu'"> + <xsl:element name="guisubmenu"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:when> + <xsl:when test="@text:style-name='GuiMenuItem'"> + <xsl:element name="guimenuitem"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:when> + <xsl:when test="@text:style-name='GuiButton'"> + <xsl:element name="guibutton"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:when> + <xsl:when test="@text:style-name='GuiButton'"> + <xsl:element name="guibutton"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:when> + <xsl:when test="@text:style-name='GuiLabel'"> + <xsl:element name="guilabel"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:when> + <xsl:when test="@text:style-name='Emphasis'"> + <xsl:element name="emphasis"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:when> + <xsl:when test="@text:style-name='FileName'"> + <xsl:element name="filename"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:when> + <xsl:when test="@text:style-name='Application'"> + <xsl:element name="application"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:when> + <xsl:when test="@text:style-name='Command'"> + <command> + <xsl:apply-templates/> + </command> + </xsl:when> + <xsl:when test="@text:style-name='SubScript'"> + <subscript> + <xsl:apply-templates/> + </subscript> + </xsl:when> + <xsl:when test="@text:style-name='SuperScript'"> + <superscript> + <xsl:apply-templates/> + </superscript> + </xsl:when> + <xsl:when test="@text:style-name='SystemItem'"> + <systemitem> + <xsl:apply-templates/> + </systemitem> + </xsl:when> + <xsl:when test="@text:style-name='ComputerOutput'"> + <computeroutput> + <xsl:apply-templates/> + </computeroutput> + </xsl:when> + <xsl:when test="@text:style-name='Highlight'"> + <highlight> + <xsl:apply-templates/> + </highlight> + </xsl:when> + <xsl:when test="@text:style-name='KeyCap'"> + <keycap> + <xsl:apply-templates/> + </keycap> + </xsl:when> + <xsl:when test="@text:style-name='KeySym'"> + <xsl:element name="keysym"> + <xsl:apply-templates/> + </xsl:element> + </xsl:when> + <xsl:when test="@text:style-name='KeyCombo'"> + <keycombo> + <xsl:apply-templates/> + </keycombo> + </xsl:when> + <xsl:when test="@text:style-name='XMLComment'"> + <xsl:comment> + <xsl:value-of select="."/> + </xsl:comment> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template match="text:a"> + <xsl:choose> + <xsl:when test="contains(@xlink:href,'://')"> + <xsl:element name="ulink"> + <xsl:attribute name="url"> + <xsl:value-of select="@xlink:href"/> + </xsl:attribute> + <xsl:apply-templates/> + </xsl:element> + </xsl:when> + <xsl:when test="not(contains(@xlink:href,'#'))"> + <xsl:element name="olink"> + <xsl:attribute name="targetdocent"> + <xsl:value-of select="@xlink:href"/> + </xsl:attribute> + <xsl:apply-templates/> + </xsl:element> + </xsl:when> + <xsl:otherwise> + <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:attribute> + <xsl:apply-templates/> + </xsl:element> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template match="text:line-break"> + <xsl:text disable-output-escaping="yes"/> + </xsl:template> + + + <xsl:template match="text:tab-stop"> + <xsl:text disable-output-escaping="yes"/> + </xsl:template> + <!-- @endterm not retained due to problems with OOo method of displaying text in the reference-ref --> + + <xsl:template match="text:reference-ref"> + <xsl:element name="xref"> + <xsl:attribute name="linkend"> + <xsl:value-of select="@text:ref-name"/> + </xsl:attribute> + </xsl:element> + </xsl:template> + + + <xsl:template name="id.attribute"> + <xsl:if test="child::text:reference-mark-start"> + <xsl:attribute name="id"> + <xsl:value-of select="child::text:reference-mark-start/@text:name"/> + </xsl:attribute> + </xsl:if> + <!-- Constraints imposed by OOo method of displaying reference-ref text means that xreflabel and endterm are lost --> + <!--<xsl:if test="child::text:p/text:span[@text:style-name = 'XrefLabel']"> + <xsl:attribute name="xreflabel"> + <xsl:value-of select="text:p/text:span"/> + </xsl:attribute> + </xsl:if> --> + + </xsl:template> + <!-- + <text:h text:level="1">Part One Title + <text:reference-mark-start text:name="part"/> + <text:p text:style-name="Text body"> + <text:span text:style-name="XrefLabel">xreflabel_part</text:span> + </text:p> + <text:reference-mark-end text:name="part"/> + </text:h> +--> + <!--<xsl:template match="text:p/text:span[@text:style-name = 'XrefLabel']"/>--> + + <xsl:template match="text:reference-mark-start"/> + + <xsl:template match="text:reference-mark-end"/> + + <xsl:template match="comment"> + <xsl:comment> + <xsl:value-of select="."/> + </xsl:comment> + </xsl:template> + + + <xsl:template match="text:alphabetical-index-mark-start"> + <xsl:element name="indexterm"> + <xsl:attribute name="class"> + <xsl:text disable-output-escaping="yes">startofrange</xsl:text> + </xsl:attribute> + <xsl:attribute name="id"> + <xsl:value-of select="@text:id"/> + </xsl:attribute> + <!--<xsl:if test="@text:key1">--> + + <xsl:element name="primary"> + <xsl:value-of select="@text:key1"/> + </xsl:element> + <!--</xsl:if>--> + + <xsl:if test="@text:key2"> + <xsl:element name="secondary"> + <xsl:value-of select="@text:key2"/> + </xsl:element> + </xsl:if> + </xsl:element> + </xsl:template> + + + <xsl:template match="text:alphabetical-index-mark-end"> + <xsl:element name="indexterm"> + <xsl:attribute name="startref"> + <xsl:value-of select="@text:id"/> + </xsl:attribute> + <xsl:attribute name="class"> + <xsl:text disable-output-escaping="yes">endofrange</xsl:text> + </xsl:attribute> + </xsl:element> + </xsl:template> + + + <xsl:template match="text:alphabetical-index"> + <xsl:element name="index"> + <xsl:element name="title"> + <xsl:value-of select="text:index-body/text:index-title/text:p"/> + </xsl:element> + <xsl:apply-templates select="text:index-body"/> + </xsl:element> + </xsl:template> + + + <xsl:template match="text:index-body"> + <xsl:for-each select="text:p[@text:style-name = 'Index 1']"> + <xsl:element name="indexentry"> + <xsl:element name="primaryie"> + <xsl:value-of select="."/> + </xsl:element> + <xsl:if test="key('secondary_children', generate-id())"> + <xsl:element name="secondaryie"> + <xsl:value-of select="key('secondary_children', generate-id())"/> + </xsl:element> + </xsl:if> + </xsl:element> + </xsl:for-each> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file -- cgit v1.2.3