![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Whitespace behaviour >Thread Next - Re: Whitespace behaviour Re: Whitespace behaviourTo: NULL Date: 3/9/2006 6:28:00 AM Why will it > be zero space in the first, double space in the second and one space in > the third example? Because by default white-space-only text nodes are stripped off by the MSXML parser and do not reach the XSLT processor. In the second case you have 
 followed by a NL -- this is no longer a white-space-only text node and it is parsed successfully (not stripped). Then, when output by the msxml xslt processor, the browser displays both 
 and NL as spaces. > I would like to do it like example2 since I will also add logic if fields > are empty etc (don't want to add a space if a field is empty) but I don't > want two spaces between the values. > then use: <xsl:text> </xsl:text> "Hans" <hans@n...> wrote in message news:%23hptzGpQGHA.4608@t...... > Hi! > > I'm trying to do an XML-->HTML transformation using XSL (presnting the > report in IE). I have a question about whitespace/linefeeds. > If I in my xsl file have the following: > > <!--Example 1 --> > <xsl:value-of select="Address"/> > <xsl:value-of select="Zipcode"/> > <xsl:value-of select="City"/> > <xsl:value-of select="Country"/> > > all values are presented in one line without any spaces (or linefeeds). > > If I add a the space is doubled between values (still on one line) > > <!--Example 2 --> > <xsl:value-of select="Address"/>  > <xsl:value-of select="Zipcode"/>  > <xsl:value-of select="City"/>  > <xsl:value-of select="Country"/>  > > > However if I put all in one line like > <!--Example 3 --> > <xsl:value-of select="Address"/> <xsl:value-of > select="Zipcode"/> <xsl:value-of select="City"/> <xsl:value-of > select="Country"/>  > > there is just one space between the values which is what I want. Why will > it be zero space in the first, double space in the second and one space in > the third example? > > I would like to do it like example2 since I will also add logic if fields > are empty etc (don't want to add a space if a field is empty) but I don't > want two spaces between the values. > > Regards > /Hans > > | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
