]> granicus.if.org Git - docbook-dsssl/commitdiff
added abstract, fixed itemizedlist, ulink
authorSteve Ball <balls@users.sourceforge.net>
Thu, 13 Oct 2005 07:12:43 +0000 (07:12 +0000)
committerSteve Ball <balls@users.sourceforge.net>
Thu, 13 Oct 2005 07:12:43 +0000 (07:12 +0000)
xsl/wordml/specifications.xml
xsl/wordml/wordml-final.xsl

index bf0253976cc316226e5765c2391cd79e63bc38fe..e02f64dbdd35cf645b0fbffe8fed7904eca0c270 100755 (executable)
@@ -5,7 +5,7 @@
 <articleinfo><author><firstname>Bob</firstname><surname>Stayton</surname><affiliation><orgname>Sagehill
 Enterprises</orgname></affiliation></author>
 <author><firstname>Steve</firstname><surname>Ball</surname><affiliation><orgname>Zveno</orgname></affiliation></author>
-<releaseinfo>Version 1.1, dated 28 September 2005</releaseinfo> 
+<releaseinfo>Version 1.2, dated 13 Octobber 2005</releaseinfo> 
 </articleinfo> 
 <abstract>
 <para>This document specifies how DocBook  elements can be mapped to Microsoft Word styles. The specifications will be used to write conversions between DocBook XML and Microsoft's WordProcessingML (WordML).</para>
@@ -288,6 +288,11 @@ colwidth="1.00*"/>
 <entry colname="col3">Any Word paragraph with style <literal>Normal</literal> will also be converted to a <sgmltag class="element">para</sgmltag> element.</entry>
 </row>
 <row>
+<entry colname="col1">abstract</entry>
+<entry colname="col2">abstract,abstract-title</entry>
+<entry colname="col3"><sgmltag>abstract</sgmltag>/<sgmltag>para</sgmltag>.</entry>
+</row>
+<row>
 <entry colname="col1">note/para</entry>
 <entry colname="col2">note</entry>
 <entry colname="col3">Consecutive paragraphs with style "note" after the first note are to be treated as part of the same <sgmltag class="element">note</sgmltag> element.  That is, consecutive notes are coalesced.</entry>
index 9cf0858b6e89f254d532193fb2c3457a265cba34..8a55f7c1409fe1b1b6dacd987d2d8e62fea53c5c 100644 (file)
@@ -12,7 +12,7 @@
                       (w:pPr/w:listPr/w:ilvl/@w:val = "0" and
                       w:pPr/w:listPr/wx:t/@wx:val = "&#183;" and
                       w:pPr/w:listPr/wx:font/@wx:val = "Symbol")]'>
-<!ENTITY itemizedlist1 'w:p[w:pPr/w:pStyle/@w:val = "itemizedlist" or
+<!ENTITY itemizedlist1 'w:p[w:pPr/w:pStyle/@w:val = "itemizedlist1" or
                        (w:pPr/w:listPr/w:ilvl/@w:val = "0" and
                        w:pPr/w:listPr/wx:t/@wx:val = "&#183;" and
                        w:pPr/w:listPr/wx:font/@wx:val = "Symbol")]'>
@@ -55,6 +55,9 @@
 <!ENTITY othercredit "w:p[w:pPr/w:pStyle/@w:val='othercredit']">
 <!ENTITY authorblurb "w:p[w:pPr/w:pStyle/@w:val='authorblurb']">
 
+<!ENTITY abstracttitle "w:p[w:pPr/w:pStyle/@w:val='abstract-title']">
+<!ENTITY abstract "w:p[w:pPr/w:pStyle/@w:val='abstract']">
+
 <!ENTITY xinclude "w:p[w:pPr/w:pStyle/@w:val='xinclude']">
 
 <!ENTITY surname "w:r[w:rPr/w:rStyle/@w:val='surname']">
                      ../&editor; |
                      ../&othercredit; |
                      ../&revhistory; |
-                     ../&revision;'>
+                     ../&revision; |
+                     ../&abstract;'>
         <xsl:element name='{$parent}info'>
           <title>
             <xsl:apply-templates select="w:r|w:hlink"/>
                                       ../&editor; |
                                       ../&othercredit; |
                                       ../&revhistory; |
-                                      ../&revision;'
+                                      ../&revision; |
+                                      ../&abstract;'
                               mode='metadata'/>
         </xsl:element>
       </xsl:when>
                       &affiliation; |
                       &revhistory; |
                       &revision; |
-                      &revremark;" mode='group'/>
+                      &revremark; |
+                      &abstracttitle; |
+                      &abstract;" mode='group'/>
+  <xsl:template match='&abstracttitle;' mode='metadata'/>
+  <xsl:template match='&abstract;' mode='metadata'>
+    <xsl:choose>
+      <xsl:when test='preceding-sibling::*[1][self::&abstracttitle;]'>
+       <abstract>
+         <title>
+           <xsl:apply-templates
+              select='preceding-sibling::*[1]/*[self::w:r|self::w:hlink]'/>
+         </title>
+         <xsl:apply-templates select='.' mode='abstract'/>
+       </abstract>
+      </xsl:when>
+      <xsl:when test='preceding-sibling::*[1][not(self::&abstract;)]'>
+       <abstract>
+         <xsl:apply-templates select='.' mode='abstract'/>
+       </abstract>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+  <xsl:template match='*' mode='abstract'/>
+  <xsl:template match='&abstract;' mode='abstract'>
+    <para>
+      <xsl:call-template name='object.id'/>
+      <xsl:apply-templates select="w:r|w:hlink"/>
+    </para>
+    <xsl:apply-templates select='following-sibling::*[1]' mode='abstract'/>
+  </xsl:template>
   <xsl:template match="&releaseinfo;" mode='metadata'>
     <releaseinfo>
       <xsl:call-template name='attributes'/>
 
     <!-- Identify the node that follows all the listitems -->
     <xsl:variable name="stop.node"
-      select="generate-id(following-sibling::*[not(self::&itemizedlist;
+      select="following-sibling::*[not(self::&itemizedlist;
               or self::&continue;
-              or self::&orderedlist;)][1])"/>
+              or self::&orderedlist;)][1]"/>
+    <xsl:variable name='stop.node.id' select='generate-id($stop.node)'/>
 
     <!-- Start the list and process all the level 1 listitems -->
     <itemizedlist>
-      <xsl:apply-templates mode="item" 
-        select=".|following-sibling::&itemizedlist;[&listlevel; = '']
-                [following-sibling::*[generate-id() = $stop.node]]">
-        <xsl:with-param name="depth" select="1"/>
-      </xsl:apply-templates>
+      <xsl:choose>
+       <xsl:when test='$stop.node'>
+         <xsl:apply-templates
+            mode="item" 
+            select=".|following-sibling::&itemizedlist;[&listlevel; = '' or &listlevel; = '1']
+                    [following-sibling::*[generate-id() = $stop.node.id]]">
+            <xsl:with-param name="depth" select="1"/>
+         </xsl:apply-templates>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:apply-templates
+            mode='item'
+            select='.|following-sibling::&itemizedlist;[&listlevel; = "" or &listlevel; = "1"]'/>
+       </xsl:otherwise>
+      </xsl:choose>
     </itemizedlist>
 
   </xsl:template>
 
-  <xsl:template match="&itemizedlist;" mode="item">
+  <xsl:template match="&itemizedlist;|&itemizedlist1;" mode="item">
     <xsl:param name="depth" select="1"/>
 
     <listitem>
         <xsl:with-param name="depth" select="$depth + 1"/>
       </xsl:apply-templates>
     </listitem>
-
   </xsl:template>
 
   <xsl:template match="&itemizedlist;" mode="subgroup">
   </link>
 </xsl:template>
 
-<xsl:template match="w:hlink[w:r/w:rPr/w:rStyle[@w:val='ulink' or @w:val='Hyperlink']]">
+<xsl:template match="w:hlink[w:r/w:rPr/w:u |
+                    w:r/w:rPr/w:rStyle[@w:val='ulink' or @w:val='Hyperlink']]">
   <ulink url='{@w:dest}'>
     <xsl:apply-templates select="w:r"/>
   </ulink>
   <xsl:template match='w:r[starts-with(w:rPr/w:rStyle/@w:val, "emphasis")]'
                priority='2'>
     <xsl:choose>
+      <xsl:when test='ancestor::w:hlink'>
+       <xsl:apply-templates select='w:t'/>
+      </xsl:when>
       <xsl:when test='w:rPr/w:rStyle/@w:val = "emphasis-bold"'>
        <emphasis role='bold'>
          <xsl:apply-templates select="w:t"/>