Re: Refactor newlines in dump-commands XSL

2007-07-20 Thread M.Canales.es
El Viernes, 20 de Julio de 2007 02:08, Dan Nicholson escribió:
 Manuel,

 I was playing with the dump-commands output and saw a couple things that
 I thought could be cleaned up. First, I think it's nicer to create a
 global variable for newlines instead of always using the entity directly.
 Second, there were an excessive number of newlines in the output. Now,
 there is just an extra newline at the end of each screen block.

 What do you think?

Looks good to me.

Actually, when updating to the new XSL code, I was tempted to remove 
dump-commads.xsl in favour of jhalfs generated scripts, but keeped due that 
is more fast and their output is more raw.

-- 
Manuel Canales Esparcia
Usuario de LFS nº2886:   http://www.linuxfromscratch.org
LFS en castellano: http://www.escomposlinux.org/lfs-es http://www.lfs-es.info
TLDP-ES:   http://es.tldp.org
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Refactor newlines in dump-commands XSL

2007-07-20 Thread Dan Nicholson
On 7/20/07, M.Canales.es [EMAIL PROTECTED] wrote:
 El Viernes, 20 de Julio de 2007 02:08, Dan Nicholson escribió:
  Manuel,
 
  I was playing with the dump-commands output and saw a couple things that
  I thought could be cleaned up. First, I think it's nicer to create a
  global variable for newlines instead of always using the entity directly.
  Second, there were an excessive number of newlines in the output. Now,
  there is just an extra newline at the end of each screen block.
 
  What do you think?

 Looks good to me.

OK, I'm going to commit that. Do you mind if I use a similar variable
in jhalfs/LFS/lfs.xsl?

 Actually, when updating to the new XSL code, I was tempted to remove
 dump-commads.xsl in favour of jhalfs generated scripts, but keeped due that
 is more fast and their output is more raw.

The jhalfs stylesheet is a lot more complicated due to all the
workarounds. We should try to fold some of those back into the XML to
get rid of the hacks. But it's nice to have the dump-commands
templates for quick testing. I guess I could go either way. It might
be nicer to have the jhalfs stylesheet here and just sync them.

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


Re: Refactor newlines in dump-commands XSL

2007-07-20 Thread M.Canales.es
El Viernes, 20 de Julio de 2007 19:22, Dan Nicholson escribió:


 OK, I'm going to commit that. Do you mind if I use a similar variable
 in jhalfs/LFS/lfs.xsl?

If you have commits right to the ALFS repo, fell free to do the changes.

I'm very busy now trying to install some usable host system with full hardware 
support for my new AMD64 machine.

-- 
Manuel Canales Esparcia
Usuario de LFS nº2886:   http://www.linuxfromscratch.org
LFS en castellano: http://www.escomposlinux.org/lfs-es http://www.lfs-es.info
TLDP-ES:   http://es.tldp.org
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: Refactor newlines in dump-commands XSL

2007-07-20 Thread Dan Nicholson
On 7/20/07, M.Canales.es [EMAIL PROTECTED] wrote:
 El Viernes, 20 de Julio de 2007 19:22, Dan Nicholson escribió:

  OK, I'm going to commit that. Do you mind if I use a similar variable
  in jhalfs/LFS/lfs.xsl?

 If you have commits right to the ALFS repo, fell free to do the changes.

No, but I will now give them to myself. Well, I might mess around in a
local branch for a while first.

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


Refactor newlines in dump-commands XSL

2007-07-19 Thread Dan Nicholson
Manuel,

I was playing with the dump-commands output and saw a couple things that
I thought could be cleaned up. First, I think it's nicer to create a
global variable for newlines instead of always using the entity directly.
Second, there were an excessive number of newlines in the output. Now,
there is just an extra newline at the end of each screen block.

What do you think?

--
Dan

 BOOK/stylesheets/dump-commands.xsl |   16 ++--
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/BOOK/stylesheets/dump-commands.xsl 
b/BOOK/stylesheets/dump-commands.xsl
index e3cac13..9e2af96 100644
--- a/BOOK/stylesheets/dump-commands.xsl
+++ b/BOOK/stylesheets/dump-commands.xsl
@@ -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
-- 
1.5.1.6

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