/[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.46, Thu Sep 25 21:41:40 2008 UTC revision 1.1.4.47, Fri Sep 26 12:22:04 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.45 2008/09/22 16:47:19 robertDouglass Exp $ -->  <!-- $Id: h2db.xsl,v 1.1.4.46 2008/09/25 21:41:40 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 108  Line 108 
108    
109   <!-- Hyperlinks -->   <!-- Hyperlinks -->
110   <xsl:template match="html:a[contains(@href,'http://')]" priority="1.5">   <xsl:template match="html:a[contains(@href,'http://')]" priority="1.5">
   <xsl:value-of select="' '"/>  
111    <xsl:element name="ulink">    <xsl:element name="ulink">
112     <xsl:attribute name="url">     <xsl:attribute name="url">
113      <xsl:value-of select="normalize-space(@href)"/>      <xsl:value-of select="normalize-space(@href)"/>
114     </xsl:attribute>     </xsl:attribute>
115     <xsl:apply-templates/>     <xsl:apply-templates/>
116    </xsl:element>    </xsl:element>
   <xsl:value-of select="' '"/>  
117   </xsl:template>   </xsl:template>
118    
119   <xsl:template match="html:a[contains(@href,'#')]" priority="0.6">   <xsl:template match="html:a[contains(@href,'#')]" priority="0.6">
   <xsl:value-of select="' '"/>  
120    <xsl:element name="link">    <xsl:element name="link">
121     <xsl:attribute name="linkend">     <xsl:attribute name="linkend">
122      <xsl:call-template name="make_id">      <xsl:call-template name="make_id">
# Line 128  Line 125 
125     </xsl:attribute>     </xsl:attribute>
126     <xsl:value-of select="."/>     <xsl:value-of select="."/>
127    </xsl:element>    </xsl:element>
   <xsl:value-of select="' '"/>  
128   </xsl:template>   </xsl:template>
129    
130   <xsl:template match="html:a[@href != '']">   <xsl:template match="html:a[@href != '']">
   <xsl:value-of select="' '"/>  
131    <xsl:element name="link">    <xsl:element name="link">
132     <xsl:attribute name="linkend">     <xsl:attribute name="linkend">
133      <xsl:value-of select="$prefix"/>      <xsl:value-of select="$prefix"/>
# Line 142  Line 137 
137     </xsl:attribute>     </xsl:attribute>
138     <xsl:value-of select="."/>     <xsl:value-of select="."/>
139    </xsl:element>    </xsl:element>
   <xsl:value-of select="' '"/>  
140    <!-- Most of the time the <xsl:value-of select="."/> will    <!-- Most of the time the <xsl:value-of select="."/> will
141         take care of all the needs of the child nodes. In the         take care of all the needs of the child nodes. In the
142         case of dfn and acronym, however, extra processing is in         case of dfn and acronym, however, extra processing is in
# Line 812  Line 806 
806   </xsl:template>   </xsl:template>
807    
808   <!-- text() handling. Some paragraphs in XHTML are really a collection of text nodes and inline elements.   <!-- text() handling. Some paragraphs in XHTML are really a collection of text nodes and inline elements.
809        these templates look at each text node, determine what kind of parent and siblings it has, and        These templates look at each text node, determine what kind of parent and siblings it has, and
810        inserts a [[para]] or [[/para]] placeholder where <para> or </para> should be. I couldn't find a way        inserts a [[para]] or [[/para]] placeholder where <para> or </para> should be. I couldn't find a way
811        to get XSLT to insert <para> or </para> because they would be unmatched elements, and you can't do that. -->        to get XSLT to insert <para> or </para> because they would be unmatched elements, and you can't do that. -->
812   <xsl:template match="text()">   <xsl:template match="text()">
# Line 860  Line 854 
854             <xsl:with-param name="element_name" select="name()"/>             <xsl:with-param name="element_name" select="name()"/>
855            </xsl:call-template>            </xsl:call-template>
856           </xsl:variable>           </xsl:variable>
857             <!-- if the previous node was a block level element print [[para]] -->
858           <xsl:if test="'true' = $last_is_block_level">           <xsl:if test="'true' = $last_is_block_level">
859            <xsl:text>[[para]]</xsl:text>            <xsl:text>[[para]]</xsl:text>
860           </xsl:if>           </xsl:if>
# Line 870  Line 865 
865      </xsl:if>      </xsl:if>
866    
867      <!-- this prints the actual text. -->      <!-- this prints the actual text. -->
868      <xsl:copy-of select="normalize-space(.)"/>      <xsl:copy-of select="."/>
869    
870      <xsl:if test="'true' = $is_block_level">      <xsl:if test="'true' = $is_block_level">
871       <!-- if there are no following nodes, or if the immediate following is block level, print </para> -->       <!-- If there are no following nodes, or if the immediate following is block level, print [[/para]] -->
872       <xsl:choose>       <xsl:choose>
873        <xsl:when test="count(following-sibling::* | following-sibling::text()) = 0">        <xsl:when test="count(following-sibling::* | following-sibling::text()) = 0">
874         <xsl:text>[[/para]]</xsl:text>         <xsl:text>[[/para]]</xsl:text>

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

  ViewVC Help
Powered by ViewVC 1.1.2