|
Subject: Re: [xsl] RE: need to show spaces From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx> Date: Thu, 14 Mar 2002 15:50:32 -0500 |
You have to get very clear on what you want. Your transformation does
actually output all the spaces that were originally present. A browser will
display all the spaces as a single visible space. So the extra spaces
normally will not show in a browser even though they are present in the
document.
You can force the browser to show spaces by using nonbreaking spaces (
in html, but in xml use   instead). It is a browser issue, not an xslt
problem. You can, however, solve it with xslt.
You can change the spaces to nonbreaking spaces by using translate():
<xsl:value-of select='translate(@val," "," ")'/>
Cheers,
Tom P
[Anurag Batra]
I am facing a problem with XSL.
I have in my XML
<a>
<b val="11 22 33 44 55"></b>
<b val="aa bb cc dd ee"></b>
<b val="12 12 12 12 12"></b>
<b val="44 55 66 77 88"></b>
</a>
in my XSL i have
<table>
<xsl:for-each select="a/b">
<tr>
<td><xsl:value-of select="@val"/></td>
</tr>
</xsl:for-each>
</table>
the output does not shows the spaces as they are. It just shows one space
gap between them. I want the string to appear as it is without any
formatting(trimming).
I have put
<xsl:preserve-space elements="a"/> in the XSL but doesnt make a diff.
whats the way to overcome this problem?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] RE: need to show spaces, Joerg Heinicke | Thread | Re: [xsl] RE: need to show spaces, Anurag Batra |
| Re: [xsl] RE: need to show spaces, Joerg Heinicke | Date | Re: [xsl] RE: need to show spaces, Anurag Batra |
| Month |