[jsword-svn] bibledesktop/resource/xsl/cswing s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Fri Mar 4 05:52:49 MST 2005


Update of /cvs/jsword/bibledesktop/resource/xsl/cswing
In directory www.crosswire.org:/tmp/cvs-serv8737/resource/xsl/cswing

Modified Files:
	simple.xsl 
Log Message:
Worked on improving the html whitespace problems. This was made evident with NASB.
Fixed the NASB strongs problem.
Changed the output of errors on OSIS parsing to include the entire text.

Index: simple.xsl
===================================================================
RCS file: /cvs/jsword/bibledesktop/resource/xsl/cswing/simple.xsl,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** simple.xsl	4 Mar 2005 04:04:32 -0000	1.9
--- simple.xsl	4 Mar 2005 12:52:47 -0000	1.10
***************
*** 3,8 ****
  
    <xsl:output method="html" omit-xml-declaration="yes" indent="no"/>
!   <xsl:strip-space elements="*"/>
! 
    <xsl:param name="strongs.hebrew.url" select="'dict:'"/>
    <xsl:param name="strongs.greek.url" select="'dict:'"/>
--- 3,15 ----
  
    <xsl:output method="html" omit-xml-declaration="yes" indent="no"/>
!   <!-- Be very careful about introducing whitespace into the document.
!        strip-space merely remove space between one tag and another tag.
!        This may cause significant whitespace to be removed.
!        
!        It is easy to have apply-templates on a line to itself which if
!        it encounters text before anything else will introduce whitespace.
!        With the browser we are using span will introduce whitespace,
!        but font does not. Therefore we use font as a span.
!     -->
    <xsl:param name="strongs.hebrew.url" select="'dict:'"/>
    <xsl:param name="strongs.greek.url" select="'dict:'"/>
***************
*** 83,87 ****
            SUP.verse { font-size: 75%; color: gray; }
            SUP.note { font-size: 75%; color: green; }
!           FONT.verse { }
            h3 { font-size: 110%; color: #666699; font-weight: bold; }
            h2 { font-size: 115%; color: #669966; font-weight: bold; }
--- 90,95 ----
            SUP.verse { font-size: 75%; color: gray; }
            SUP.note { font-size: 75%; color: green; }
!           FONT.jesus { color: red; }
!           FONT.speech { color: blue; }
            h3 { font-size: 110%; color: #666699; font-weight: bold; }
            h2 { font-size: 115%; color: #669966; font-weight: bold; }
***************
*** 133,143 ****
  
    <!--=======================================================================-->
    <xsl:template match="osisCorpus">
      <xsl:for-each select="osisText">
        <!-- If this text has a header, apply templates to the header. -->
        <xsl:if test="preceding-sibling::*[1][self::header]">
!         <div class="corpus-text-header">
!           <xsl:apply-templates select="preceding-sibling::*[1][self::header]"/>
!         </div>
        </xsl:if>
        <xsl:apply-templates select="."/>
--- 141,150 ----
  
    <!--=======================================================================-->
+   <!-- Avoid adding whitespace -->
    <xsl:template match="osisCorpus">
      <xsl:for-each select="osisText">
        <!-- If this text has a header, apply templates to the header. -->
        <xsl:if test="preceding-sibling::*[1][self::header]">
!         <div class="corpus-text-header"><xsl:apply-templates select="preceding-sibling::*[1][self::header]"/></div>
        </xsl:if>
        <xsl:apply-templates select="."/>
***************
*** 188,195 ****
  
    <!--=======================================================================-->
    <xsl:template match="a">
!     <a href="{@href}">
!       <xsl:apply-templates/>
!     </a>
    </xsl:template>
  
--- 195,201 ----
  
    <!--=======================================================================-->
+   <!-- Avoid adding whitespace -->
    <xsl:template match="a">
!     <a href="{@href}"><xsl:apply-templates/></a>
    </xsl:template>
  
***************
*** 224,227 ****
--- 230,234 ----
    <!--=======================================================================-->
    <xsl:template match="p" mode="print-notes">
+     <!-- FIXME: This ignores text in the note. -->
      <!-- don't put para's in notes -->
    </xsl:template>
***************
*** 234,238 ****
        <xsl:variable name="next-position" select="position() + 1"/>
        <xsl:choose>
!         <xsl:when test="$strongs = 'true' and starts-with(@lemma, 'x-Strongs:')">
            <xsl:variable name="orig-lemma" select="substring-after(@lemma, ':')"/>
            <xsl:variable name="strongs-type" select="substring($orig-lemma, 1, 1)"/>
--- 241,245 ----
        <xsl:variable name="next-position" select="position() + 1"/>
        <xsl:choose>
!         <xsl:when test="$strongs = 'true' and (starts-with(@lemma, 'x-Strongs:') or starts-with(@lemma, 'strong:'))">
            <xsl:variable name="orig-lemma" select="substring-after(@lemma, ':')"/>
            <xsl:variable name="strongs-type" select="substring($orig-lemma, 1, 1)"/>
***************
*** 270,287 ****
  
    <!--=======================================================================-->
    <xsl:template match="seg">
      <xsl:choose>
        <xsl:when test="starts-with(@type, 'color:')">
!         <font color="substring-before(substring-after(@type, 'color: '), ';')">
!           <xsl:apply-templates/>
!         </font>
        </xsl:when>
        <xsl:when test="starts-with(@type, 'font-size:')">
!         <font size="substring-before(substring-after(@type, 'font-size: '), ';')">
!           <xsl:apply-templates/>
!         </font>
        </xsl:when>
        <xsl:otherwise>
!         <p><xsl:apply-templates/></p>
        </xsl:otherwise>
      </xsl:choose>
--- 277,291 ----
  
    <!--=======================================================================-->
+   <!-- Avoid adding whitespace -->
    <xsl:template match="seg">
      <xsl:choose>
        <xsl:when test="starts-with(@type, 'color:')">
!         <font color="substring-before(substring-after(@type, 'color: '), ';')"><xsl:apply-templates/></font>
        </xsl:when>
        <xsl:when test="starts-with(@type, 'font-size:')">
!         <font size="substring-before(substring-after(@type, 'font-size: '), ';')"><xsl:apply-templates/></font>
        </xsl:when>
        <xsl:otherwise>
!         <xsl:apply-templates/>
        </xsl:otherwise>
      </xsl:choose>
***************
*** 289,292 ****
--- 293,297 ----
    
    <!--=======================================================================-->
+   <!-- FIXME: Should we both expand and output?? -->
    <xsl:template match="abbr">
      <abbr class="abbr">
***************
*** 301,315 ****
  
    <!--=======================================================================-->
    <xsl:template match="speaker">
      <xsl:choose>
        <xsl:when test="@who='Jesus'">
!         <font color="red">
!           <xsl:apply-templates/>
!         </font>
        </xsl:when>
        <xsl:otherwise>
!         <font color="blue">
!           <xsl:apply-templates/>
!         </font>
        </xsl:otherwise>
      </xsl:choose>
--- 306,317 ----
  
    <!--=======================================================================-->
+   <!-- Avoid adding whitespace -->
    <xsl:template match="speaker">
      <xsl:choose>
        <xsl:when test="@who='Jesus'">
!         <font class="jesus"><xsl:apply-templates/></font>
        </xsl:when>
        <xsl:otherwise>
!         <font class="speech"><xsl:apply-templates/></font>
        </xsl:otherwise>
      </xsl:choose>
***************
*** 317,324 ****
  
    <!--=======================================================================-->
    <xsl:template match="title">
!     <h2>
!       <xsl:apply-templates/>
!     </h2>
    </xsl:template>
  
--- 319,325 ----
  
    <!--=======================================================================-->
+   <!-- Avoid adding whitespace -->
    <xsl:template match="title">
!     <h2><xsl:apply-templates/></h2>
    </xsl:template>
  
***************
*** 333,354 ****
  
    <!--=======================================================================-->
    <xsl:template match="reference">
!     <a href="bible://{@osisRef}">
!       <xsl:apply-templates/>
!     </a>
    </xsl:template>
    
    <!--=======================================================================-->
! 
    <xsl:template match="caption">
!     <div class="caption">
!       <xsl:apply-templates/>
!     </div>
    </xsl:template>
    
    <xsl:template match="catchWord">
!     <span class="catchWord">
!       <xsl:apply-templates/>
!     </span>
    </xsl:template>
    
--- 334,351 ----
  
    <!--=======================================================================-->
+   <!-- Avoid adding whitespace -->
    <xsl:template match="reference">
!     <a href="bible://{@osisRef}"><xsl:apply-templates/></a>
    </xsl:template>
    
    <!--=======================================================================-->
!   <!-- Avoid adding whitespace -->
    <xsl:template match="caption">
!     <div class="caption"><xsl:apply-templates/></div>
    </xsl:template>
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="catchWord">
!     <font class="catchWord"><xsl:apply-templates/></font>
    </xsl:template>
    
***************
*** 358,377 ****
    -->
    
    <xsl:template match="closer">
!     <div class="closer">
!       <xsl:apply-templates/>
!     </div>
    </xsl:template>
    
    <xsl:template match="date">
!     <span class="date">
!       <xsl:apply-templates/>
!     </span>
    </xsl:template>
    
    <xsl:template match="divineName">
!     <span class="divineName">
!       <xsl:apply-templates/>
!     </span>
    </xsl:template>
    
--- 355,371 ----
    -->
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="closer">
!     <div class="closer"><xsl:apply-templates/></div>
    </xsl:template>
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="date">
!     <font class="date"><xsl:apply-templates/></font>
    </xsl:template>
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="divineName">
!     <font class="divineName"><xsl:apply-templates/></font>
    </xsl:template>
    
***************
*** 383,404 ****
    </xsl:template>
    
    <xsl:template match="foreign">
!     <em class="foreign">
!       <xsl:apply-templates/>
!     </em>
    </xsl:template>
    
    <!-- This is a subheading. -->
    <xsl:template match="head//head">
!     <h5 class="head">
!       <xsl:apply-templates/>
!     </h5>
    </xsl:template>
    
    <!-- This is a top-level heading. -->
    <xsl:template match="head">
!     <h4 class="head">
!       <xsl:apply-templates/>
!     </h4>
    </xsl:template>
    
--- 377,395 ----
    </xsl:template>
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="foreign">
!     <em class="foreign"><xsl:apply-templates/></em>
    </xsl:template>
    
    <!-- This is a subheading. -->
+   <!-- Avoid adding whitespace -->
    <xsl:template match="head//head">
!     <h5 class="head"><xsl:apply-templates/></h5>
    </xsl:template>
    
    <!-- This is a top-level heading. -->
+   <!-- Avoid adding whitespace -->
    <xsl:template match="head">
!     <h4 class="head"><xsl:apply-templates/></h4>
    </xsl:template>
    
***************
*** 407,420 ****
    </xsl:template>
    
    <xsl:template match="inscription">
!     <span class="inscription">
!       <xsl:apply-templates/>
!     </span>
    </xsl:template>
    
    <xsl:template match="item">
!     <li class="item">
!       <xsl:apply-templates/>
!     </li>
    </xsl:template>
    
--- 398,409 ----
    </xsl:template>
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="inscription">
!     <font class="inscription"><xsl:apply-templates/></font>
    </xsl:template>
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="item">
!     <li class="item"><xsl:apply-templates/></li>
    </xsl:template>
    
***************
*** 423,438 ****
    -->
    
    <xsl:template match="l">
!     <div class="l">
!       <xsl:apply-templates/>
!     </div>
    </xsl:template>
    
    <xsl:template match="lg">
!     <div class="lg">
!       <xsl:apply-templates/>
!     </div>
    </xsl:template>
    
    <xsl:template match="list">
      <xsl:choose>
--- 412,426 ----
    -->
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="l">
!     <div class="l"><xsl:apply-templates/></div>
    </xsl:template>
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="lg">
!     <div class="lg"><xsl:apply-templates/></div>
    </xsl:template>
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="list">
      <xsl:choose>
***************
*** 443,459 ****
              <xsl:choose>
                <xsl:when test="self::label">
!                 <dt class="label">
!                   <xsl:apply-templates/>
!                 </dt>
                </xsl:when>
                <xsl:when test="self::item">
!                 <dd class="item">
!                   <xsl:apply-templates/>
!                 </dd>
                </xsl:when>
                <xsl:when test="self::list">
!                 <dd class="list-wrapper">
!                   <xsl:apply-templates select="."/>
!                 </dd>
                </xsl:when>
                <xsl:otherwise>
--- 431,441 ----
              <xsl:choose>
                <xsl:when test="self::label">
!                 <dt class="label"><xsl:apply-templates/></dt>
                </xsl:when>
                <xsl:when test="self::item">
!                 <dd class="item"><xsl:apply-templates/></dd>
                </xsl:when>
                <xsl:when test="self::list">
!                 <dd class="list-wrapper"><xsl:apply-templates select="."/></dd>
                </xsl:when>
                <xsl:otherwise>
***************
*** 471,482 ****
              <xsl:choose>
                <xsl:when test="self::item">
!                 <li class="item">
!                   <xsl:apply-templates/>
!                 </li>
                </xsl:when>
                <xsl:when test="self::list">
!                 <li class="list-wrapper">
!                   <xsl:apply-templates select="."/>
!                 </li>
                </xsl:when>
                <xsl:otherwise>
--- 453,460 ----
              <xsl:choose>
                <xsl:when test="self::item">
!                 <li class="item"><xsl:apply-templates/></li>
                </xsl:when>
                <xsl:when test="self::list">
!                 <li class="list-wrapper"><xsl:apply-templates select="."/></li>
                </xsl:when>
                <xsl:otherwise>
***************
*** 490,497 ****
    </xsl:template>
    
    <xsl:template match="mentioned">
!     <span class="mentioned">
!       <xsl:apply-templates/>
!     </span>
    </xsl:template>
    
--- 468,474 ----
    </xsl:template>
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="mentioned">
!     <font class="mentioned"><xsl:apply-templates/></font>
    </xsl:template>
    
***************
*** 503,509 ****
    
    <xsl:template match="name">
!     <span class="name">
!       <xsl:apply-templates/>
!     </span>
    </xsl:template>
    
--- 480,484 ----
    
    <xsl:template match="name">
!     <font class="name"><xsl:apply-templates/></font>
    </xsl:template>
    
***************
*** 531,538 ****
    </xsl:template>
    
    <xsl:template match="rdg">
!     <div class="rdg">
!       <xsl:apply-templates/>
!     </div>
    </xsl:template>
  
--- 506,512 ----
    </xsl:template>
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="rdg">
!     <div class="rdg"><xsl:apply-templates/></div>
    </xsl:template>
  
***************
*** 541,580 ****
    -->
    
    <xsl:template match="salute">
!     <div class="salute">
!       <xsl:apply-templates/>
!     </div>
    </xsl:template>
    
    <xsl:template match="signed">
!     <span class="signed">
!       <xsl:apply-templates/>
!     </span>
    </xsl:template>
  
    <xsl:template match="speech">
!     <div class="speech">
!       <xsl:apply-templates/>
!     </div>
    </xsl:template>
    
    <xsl:template match="table">
      <table class="table">
        <xsl:copy-of select="@rows|@cols"/>
        <xsl:if test="head">
!         <thead class="head">
!           <xsl:apply-templates select="head"/>
!         </thead>
        </xsl:if>
!       <tbody>
!         <xsl:apply-templates select="row"/>
!       </tbody>
      </table>
    </xsl:template>
    
    <xsl:template match="row">
!     <tr class="row">
!       <xsl:apply-templates/>
!     </tr>
    </xsl:template>
    
--- 515,547 ----
    -->
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="salute">
!     <div class="salute"><xsl:apply-templates/></div>
    </xsl:template>
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="signed">
!     <font class="signed"><xsl:apply-templates/></font>
    </xsl:template>
  
+   <!-- Avoid adding whitespace -->
    <xsl:template match="speech">
!     <div class="speech"><xsl:apply-templates/></div>
    </xsl:template>
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="table">
      <table class="table">
        <xsl:copy-of select="@rows|@cols"/>
        <xsl:if test="head">
!         <thead class="head"><xsl:apply-templates select="head"/></thead>
        </xsl:if>
!       <tbody><xsl:apply-templates select="row"/></tbody>
      </table>
    </xsl:template>
    
+   <!-- Avoid adding whitespace -->
    <xsl:template match="row">
!     <tr class="row"><xsl:apply-templates/></tr>
    </xsl:template>
    
***************
*** 607,614 ****
    </xsl:template>
  
    <xsl:template match="transChange">
!     <span class="transChange">
!       <xsl:apply-templates/>
!     </span>
    </xsl:template>
    
--- 574,580 ----
    </xsl:template>
  
+   <!-- Avoid adding whitespace -->
    <xsl:template match="transChange">
!     <font class="transChange"><xsl:apply-templates/></font>
    </xsl:template>
    
***************
*** 616,626 ****
        <xsl:choose>
          <xsl:when test="@rend = 'bold'">
!           <b><xsl:apply-templates/></b>
          </xsl:when>
          <xsl:when test="@rend = 'illuminated'">
!           <b><i><xsl:apply-templates/></i></b>
          </xsl:when>
          <xsl:when test="@rend = 'italic'">
!           <i><xsl:apply-templates/></i>
          </xsl:when>
          <xsl:when test="@rend = 'line-through'">
--- 582,592 ----
        <xsl:choose>
          <xsl:when test="@rend = 'bold'">
!           <strong><xsl:apply-templates/></strong>
          </xsl:when>
          <xsl:when test="@rend = 'illuminated'">
!           <strong><em><xsl:apply-templates/></em></strong>
          </xsl:when>
          <xsl:when test="@rend = 'italic'">
!           <em><xsl:apply-templates/></em>
          </xsl:when>
          <xsl:when test="@rend = 'line-through'">



More information about the jsword-svn mailing list