New line , white spaces and colors .

Subject: New line , white spaces and colors .
From: "Chanukov Orit" <orit@xxxxxxxxxxxxxxx>
Date: Tue, 29 Jun 1999 18:25:32 +0200
Hello .
I work with IE5 .I have a little (hopefully) problem  .
Here is my XML file  :
<?xml version='1.0'?>
<?xml:stylesheet type="text/xsl" href="" ?>
<Screen >
    <Field colr="0">                    First Field should be displayed with offset 20 .</Field>
    <Field colr="1"> Second field should be shown on the same line </Field>
I need :
1.To display all Fields on the same line .
2. To preserve white spaces ( I use <PRE> element for this purpose ) .
3.To get the value of  the Field's "colr" attribute and according to this attribute to set the color of the displayed text .
My XSL does 2 and 3 successfully , but failed with 1- it starts the second Field from the new line .Why ?
   If I delete the <font> section from the Field template , it works correctly ,but without color processing .
   If I don't use <PRE> element , it displays the two fields on the same line and with correct color , but  strips the white spaces .(I tried a lot of another variants for preserving white spaces , but it was solved only by using <PRE> element ) .
Below you can see my XSL file :
Fields.xsl :
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="">
<xsl:template match="/">
<HTML xmlns:xsl="">
 <BODY STYLE="background-color:silver"  >
 <xsl:apply-templates />
<xsl:template match="Screen">
    <PRE><xsl:apply-templates /></PRE>
<xsl:template match="Field">
       <xsl:apply-templates select="@colr"/>
    <xsl:apply-templates />
<xsl:template match="text()"><xsl:value-of /></xsl:template>
<xsl:template match="@colr">
<xsl:attribute name="STYLE">color:
        <xsl:when test=".[.='J']">blue</xsl:when >
        <xsl:otherwise >black</xsl:otherwise >
Thanks in advance for any ideas , examples and comments .
Orit .
Current Thread