[sword-svn] r126 - in trunk/thml2osis/xslt: . tests

lukeplant at www.crosswire.org lukeplant at www.crosswire.org
Fri Nov 30 08:47:35 MST 2007


Author: lukeplant
Date: 2007-11-30 08:47:34 -0700 (Fri, 30 Nov 2007)
New Revision: 126

Modified:
   trunk/thml2osis/xslt/tests/body1.osis.flat
   trunk/thml2osis/xslt/thml2osis.xslt
Log:
Changed handling of general tags so that they are not
copied if they have no child nodes or text.  (Need to 
review whether this is right for all elements handled
by this code path - it is certainly useful for empty 
<p/> elements and most others)



Modified: trunk/thml2osis/xslt/tests/body1.osis.flat
===================================================================
--- trunk/thml2osis/xslt/tests/body1.osis.flat	2007-11-29 23:41:08 UTC (rev 125)
+++ trunk/thml2osis/xslt/tests/body1.osis.flat	2007-11-30 15:47:34 UTC (rev 126)
@@ -502,8 +502,6 @@
 /osis/osisText/div/div/div/@annotateType=commentary
 /osis/osisText/div/div/div/@annotateRef=Bible:Gen.1.2
 /osis/osisText/div/div/div/@osisID=Gen.1.2
-/osis/osisText/div/div/div/p
-/osis/osisText/div/div/div/p
 /osis/osisText/div/div/div/p/hi/@type=bold
 /osis/osisText/div/div/div/p/hi=2.
 /osis/osisText/div/div/div/p/hi

Modified: trunk/thml2osis/xslt/thml2osis.xslt
===================================================================
--- trunk/thml2osis/xslt/thml2osis.xslt	2007-11-29 23:41:08 UTC (rev 125)
+++ trunk/thml2osis/xslt/thml2osis.xslt	2007-11-30 15:47:34 UTC (rev 126)
@@ -488,11 +488,13 @@
 
   <xsl:template match="//ThML.body//*">
     <!-- NB: we avoid using <xsl:copy> due to namespace issues -->
-    <xsl:element name="{name()}">
-      <xsl:call-template name="copyattributes">
-	<xsl:with-param name="exclude">id class place style</xsl:with-param>
-      </xsl:call-template>
-      <xsl:apply-templates />
-    </xsl:element>
+    <xsl:if test="*|text()"> <!-- don't copy empty elements -->
+      <xsl:element name="{name()}">
+	<xsl:call-template name="copyattributes">
+	  <xsl:with-param name="exclude">id class place style</xsl:with-param>
+	</xsl:call-template>
+	<xsl:apply-templates />
+      </xsl:element>
+    </xsl:if>
   </xsl:template>
 </xsl:stylesheet>




More information about the sword-cvs mailing list