/[drupal]/contributions/modules/export_docbook/h2db.xsl
ViewVC logotype

Diff of /contributions/modules/export_docbook/h2db.xsl

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.4.45, Mon Sep 22 16:47:19 2008 UTC revision 1.1.4.46, Thu Sep 25 21:41:40 2008 UTC
# Line 1  Line 1 
1  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
2  <!-- $Id: h2db.xsl,v 1.1.4.44 2008/09/22 15:58:41 robertDouglass Exp $ -->  <!-- $Id: h2db.xsl,v 1.1.4.45 2008/09/22 16:47:19 robertDouglass Exp $ -->
3  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4   xmlns:html="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xsl html">   xmlns:html="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xsl html">
5    
# Line 27  Line 27 
27    bridgeheads. It attempts to assign an ID to each bridgehead by looking    bridgeheads. It attempts to assign an ID to each bridgehead by looking
28    for a named anchor as a child of the header or as the immediate preceding    for a named anchor as a child of the header or as the immediate preceding
29    or following sibling -->    or following sibling -->
30   <xsl:template match="html:h1   <xsl:template
31    |html:h2    match="html:body/html:h1
32    |html:h3                      | html:body/html:h2
33    |html:h4                      | html:body/html:h3
34    |html:h5                      | html:body/html:h4
35    |html:h6">                      | html:body/html:h5
36    <xsl:choose>                      | html:body/html:h6">
    <xsl:when test="ancestor::html:ol[contains(@class, 'docbook-procedure')]"/>  
    <xsl:otherwise>  
     <bridgehead>  
      <xsl:choose>  
       <xsl:when test="count(html:a/@name)">  
        <xsl:attribute name="id">  
         <xsl:value-of select="html:a/@name"/>  
        </xsl:attribute>  
       </xsl:when>  
       <xsl:when test="preceding-sibling::* = preceding-sibling::html:a[@name != '']">  
        <xsl:attribute name="id">  
         <xsl:value-of select="concat($prefix,preceding-sibling::html:a[1]/@name)"/>  
        </xsl:attribute>  
       </xsl:when>  
       <xsl:when test="following-sibling::* = following-sibling::html:a[@name != '']">  
        <xsl:attribute name="id">  
         <xsl:value-of select="concat($prefix,following-sibling::html:a[1]/@name)"/>  
        </xsl:attribute>  
       </xsl:when>  
      </xsl:choose>  
      <xsl:apply-templates/>  
     </bridgehead>  
    </xsl:otherwise>  
   </xsl:choose>  
  </xsl:template>  
37    
38      <bridgehead>
39       <xsl:choose>
40        <xsl:when test="count(html:a/@name)">
41         <xsl:attribute name="id">
42          <xsl:value-of select="html:a/@name"/>
43         </xsl:attribute>
44        </xsl:when>
45        <xsl:when test="preceding-sibling::* = preceding-sibling::html:a[@name != '']">
46         <xsl:attribute name="id">
47          <xsl:value-of select="concat($prefix,preceding-sibling::html:a[1]/@name)"/>
48         </xsl:attribute>
49        </xsl:when>
50        <xsl:when test="following-sibling::* = following-sibling::html:a[@name != '']">
51         <xsl:attribute name="id">
52          <xsl:value-of select="concat($prefix,following-sibling::html:a[1]/@name)"/>
53         </xsl:attribute>
54        </xsl:when>
55       </xsl:choose>
56       <xsl:apply-templates/>
57      </bridgehead>
58     </xsl:template>
59    
60   <!-- These templates perform one-to-one conversions of HTML elements into   <!-- These templates perform one-to-one conversions of HTML elements into
61       DocBook elements -->       DocBook elements -->
# Line 573  Line 569 
569    <xsl:choose>    <xsl:choose>
570     <xsl:when test="./parent::html:ol[contains(@class, 'docbook-procedure')]">     <xsl:when test="./parent::html:ol[contains(@class, 'docbook-procedure')]">
571      <step>      <step>
      <xsl:if test="./html:h2 or ./html:h3 or ./html:h4 or ./html:h5 or ./html:h6">  
       <title>  
        <xsl:value-of  
         select="html:h2[text()] | html:h3[text()] | ./html:h4[text()] | ./html:h5[text()] | ./html:h6[text()]"  
        />  
       </title>  
      </xsl:if>  
572       <xsl:apply-templates/>       <xsl:apply-templates/>
573      </step>      </step>
574     </xsl:when>     </xsl:when>
# Line 591  Line 580 
580    </xsl:choose>    </xsl:choose>
581   </xsl:template>   </xsl:template>
582    
583    
584    
585     <xsl:template match="html:h2[./parent::html:li] |
586                          html:h3[./parent::html:li] |
587                          html:h4[./parent::html:li] |
588                          html:h5[./parent::html:li] |
589                          html:h6[./parent::html:li]">
590      <title>
591       <xsl:apply-templates/>
592      </title>
593     </xsl:template>
594    
595   <xsl:template match="*">   <xsl:template match="*">
596    <xsl:message>No template for <xsl:value-of select="name()"/>    <xsl:message>No template for <xsl:value-of select="name()"/>
597    </xsl:message>    </xsl:message>
# Line 622  Line 623 
623    
624   <!-- Various elements -->   <!-- Various elements -->
625   <xsl:template match="html:hr"/>   <xsl:template match="html:hr"/>
626   <xsl:template match="html:h1[1]|html:h2[1]|html:h3[1]" priority="1"/>   <xsl:template
627      match="html:h1[1] |
628                          html:div/html:h2[1] |
629                          html:h3[1]"
630      priority="1"/>
631   <xsl:template match="html:br">   <xsl:template match="html:br">
632    <!-- don't change the indentation of <xsl:text> !!! -->    <!-- don't change the indentation of <xsl:text> !!! -->
633    <xsl:text>    <xsl:text>

Legend:
Removed from v.1.1.4.45  
changed lines
  Added in v.1.1.4.46

  ViewVC Help
Powered by ViewVC 1.1.2