RE: [xsl] preserve-space

Subject: RE: [xsl] preserve-space
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Mon, 1 Jul 2002 20:14:23 +0100
> 
> I need to be able to output this table exactly as it is in 
> the input xml file. 
> I have not been able to do this. 
> I tried to this but it didn't work for me.
>         <xsl:preserve-space elements="PRE"/>
> Im not sure if i have implemented it correctly. Any help is greatly 
> appreciated.

<xsl:preserve-space> only affects what happens to text nodes that
consist entirely of whitespace.

Space characters within a non-whitespace text node are copied to the
output unless you do something drastic to get rid of them. It's the HTML
browser that's causing the trouble: HTML treats multiple space
characters as a single space. To prevent this, output the text wrapped
in an HTML <pre> element, using a fixed-width font.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 
> 
> Thank You,
> Nick
> 
> 
> <PRE>
>  
> --------------------------------------------------------------
> ----------
>                                                               
>      Code
>              Color grade                        Symbol        
>       No.
> --------------------------------------------------------------
> ----------
> Good Middling.......................  GM                      
>         11
> Strict Middling.....................  SM                      
>         21
> Middling............................  Mid                     
>         31
> Strict Low Middling.................  SLM                     
>         41
> Low Middling........................  LM                      
>         51
> Strict Good Ordinary................  SGO                     
>         61
> Good Ordinary.......................  GO                      
>         71
> Good Middling Light Spotted.........  GM Lt SP                
>         12
> Strict Middling Light Spotted.......  SM Lt Sp                
>         22
> Middling Light Spotted..............  Mid Lt Sp               
>         32
> Strict Low Middling Light Spotted...  SLM Lt Sp               
>         42
> Low Middling Light Spotted..........  LM Lt Sp                
>         52
> Stict Good Ordinary Light Spotted...  SGO Lt Sp               
>         62
> Good Middling Spotted...............  GM Sp                   
>         13
> Strict Middling Spotted.............  SM Sp                   
>         23
> Middling Spotted....................  Mid Sp                  
>         33
> Strict Low Middling Spotted.........  SLM Sp                  
>         43
> Low Middling Spotted................  LM Sp                   
>         53
> Strict Good Ordinary Spotted........  SGO Sp                  
>         63
> Strict Middling Tinged..............  SM Tg                   
>         24
> Middling Tinged.....................  Mid Tg                  
>         34
> Strict Low Middling Tinged..........  SLM Tg                  
>         44
> Low Middling Tinged.................  LM Tg                   
>         54
> Strict Middling Yellow Stained......  SM YS                   
>         25
> Middling Yellow Stained.............  Mid YS                  
>         35
> Below Grade--(Below Good Ordinary)..  BG                      
>         81
> Below Grade--(Below Strict Good       BG                      
>         82
>  Ordinary Light Spotted).
> Below Grade--(Below Strict Good       BG                      
>         83
>  Ordinary Spotted).
> Below Grade--(Below Low Middling      BG                      
>         84
>  Tinged).
> Below Grade--(Below Middling Yellow   BG                      
>         85
>  Stained).
> --------------------------------------------------------------
> ----------
> 
> </PRE>
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread