Author: dnicholson
Date: 2007-07-20 16:55:28 -0600 (Fri, 20 Jul 2007)
New Revision: 8225

Modified:
   trunk/BOOK/stylesheets/dump-commands.xsl
Log:
Cleanup newline generation in dump-commands


Modified: trunk/BOOK/stylesheets/dump-commands.xsl
===================================================================
--- trunk/BOOK/stylesheets/dump-commands.xsl    2007-07-19 17:48:20 UTC (rev 
8224)
+++ trunk/BOOK/stylesheets/dump-commands.xsl    2007-07-20 22:55:28 UTC (rev 
8225)
@@ -6,6 +6,10 @@
 
 <!-- XSLT stylesheet to extract commands from [B,H]LFS books. -->
 
+  <xsl:variable name="newline">
+    <xsl:text>&#xA;</xsl:text>
+  </xsl:variable>
+
   <xsl:template match="/">
     <xsl:apply-templates select="//sect1"/>
   </xsl:template>
@@ -47,31 +51,31 @@
     <xsl:if test="child::* = userinput">
       <xsl:choose>
         <xsl:when test="@role = 'root'">
-          <xsl:text>&#xA;</xsl:text>
           <xsl:text># Run this as root</xsl:text>
+          <xsl:value-of select="$newline"/>
           <xsl:apply-templates select="userinput"/>
           <xsl:text># End root commands</xsl:text>
-          <xsl:text>&#xA;</xsl:text>
+          <xsl:value-of select="$newline"/>
         </xsl:when>
         <xsl:otherwise>
           <xsl:apply-templates select="userinput"/>
         </xsl:otherwise>
       </xsl:choose>
+      <xsl:value-of select="$newline"/>
     </xsl:if>
   </xsl:template>
 
   <xsl:template match="userinput">
-    <xsl:text>&#xA;</xsl:text>
     <xsl:if test=".//replaceable">
       <xsl:text># This block must be edited to suit your needs.</xsl:text>
+      <xsl:value-of select="$newline"/>
     </xsl:if>
-    <xsl:text>&#xA;</xsl:text>
     <xsl:apply-templates/>
-    <xsl:text>&#xA;</xsl:text>
+    <xsl:value-of select="$newline"/>
     <xsl:if test=".//replaceable">
       <xsl:text># End of editable block.</xsl:text>
+      <xsl:value-of select="$newline"/>
     </xsl:if>
-    <xsl:text>&#xA;</xsl:text>
   </xsl:template>
 
   <xsl:template match="replaceable">

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-book
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to