[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Whitespace again

Subject: Re: Whitespace again
From: "Chanukov Orit" <orit@xxxxxxxxxxxxxxx>
Date: Tue, 29 Jun 1999 14:48:19 +0200
jsp preserve whitespace
You should  use xml:space="preserve"  in your XML and XSL files ,  and <PRE>
tag .
You should write something like this  ( I tested it with IE5 - it works ) :

spaces.xml :

<?xml version='1.0'?>
<?xml:stylesheet type="text/xsl" href="spaces.xsl" xml:space="preserve"?>
<Screen >
<text xml:space="preserve">                    line 1
line 2  </text>
</Screen>



spaces.xsl:

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML xmlns:xsl="http://www.w3.org/TR/WD-xsl">
 <BODY xml:space="preserve"  >
 <xsl:apply-templates select="Screen"/>
 </BODY>
</HTML>
</xsl:template>
<xsl:template match="Screen">
         <xsl:apply-templates />
</xsl:template>
<xsl:template match="text">
        <xsl:apply-templates />
</xsl:template>
<xsl:template match="text()"><PRE><xsl:value-of /></PRE></xsl:template>
</xsl:stylesheet>


Orit .

----- Original Message -----
From: Joerg Bauer <jb@xxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxx>
Sent: Tuesday, June 29, 1999 11:26 AM
Subject: Re: Whitespace again


> Thank you for you answer,
> but it still doesn´t work.
>
> I doing this in the Cocoon Framework (1.4). Is it possible that the
> CocoonPrinter strips the Whitespace ?? If yes, i read something about
> xml:space="preserve" but i don´t understand where and how to use it.
>
> could you help me ??
>
> Keith Visco wrote:
> >
> > Joerg,
> >
> > add the following to your top level children of your xsl:stylesheet
> > element:
> >
> > <xsl:preserve-space element="text"/>
> >
> > --Keith
> >
> > Joerg Bauer wrote:
> > >
> > > Maybe i am stupid but i can´t do it !!
> > >
> > > I have a xml documnet:
> > >
> > > <text>line 1
> > > line 2
> > > </text>
> > >
> > > ( There is linebreak in the text() - Element !!!! )
> > >
> > > and a xsl document:
> > >
> > > <xsl:template match="text">
> > >         <textarea id="input" name="mytext" rows="5" cols="30"
wrap="physical">
> > >                 <xsl:value-of select="text()"/>
> > >         <textarea>
> > > </xsl:template>
> > > My problem is that in the html output there is no linebreak. Reading
the
> > > Working-Draft (WD-xsl-1998-1216, i use xsl:p), i found out that there
is
> > > something like xsl:preserve-space etc. but i don´t understand how to
use
> > > it.
> > >
> > > Could anybody give me an example / solution..... ?
> > >
> > > --
> > > Blue Mars Interactive           http://www.bluemars.de
> > > Joerg Bauer                     mailto: jb@xxxxxxxxxxx
> > > Lersnerstrasse 23               Tel. +49 (0)69 959 42-400
> > > 60322 Frankfurt/M.              Fax  +49 (0)69 959 42-420
> > >
> > >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
> --
> Blue Mars Interactive           http://www.bluemars.de
> Joerg Bauer                     mailto: jb@xxxxxxxxxxx
> Lersnerstrasse 23               Tel. +49 (0)69 959 42-400
> 60322 Frankfurt/M.              Fax  +49 (0)69 959 42-420
>
>
>  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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.