[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: preserving whitespace in output using MSXML3


Subject: Re: preserving whitespace in output using MSXML3
From: Dan Vint <dvint@xxxxxxxx>
Date: Fri, 14 Jul 2000 10:50:02 -0700 (PDT)

When you have 2 XSLT elements together the whitespace doesn't seem to be
picked up. If you were to generate some text (an actual string) then  the
spaces generally are transmitted. To force this space use the <xsl:text>
-- insert your whitespace here -- </xsl:text> and that should output the spaces.

The other problem that sometimes kicks in is the output type being HTML
and you know how HTML reading/rendering absorbs spaces when read into a
browser occurs, the similar effect happens with HTML output.

..dan

> 
> Here is a chunk of an XSL that I've written (notice the indentation):
> ---------------------------
> <xsl:template match="ResumeData/phones">
> <var name='phones'>
> <xsl:variable name="phone_count" select="count(.//phone)"/>
> 	<array length='{$phone_count}'>
> <xsl:for-each select="phone">
> 	<struct>
> 		<var name='kind'>
> 			<string><xsl:value-of select="./@kind"/></string>
> 		</var>
> 		<var name='phone'>
> 			<string><xsl:value-of select="."/></string>
> 		</var>
> 		</struct>
> </xsl:for-each>
> 	</array>
> </var>
> </xsl:template>
> ---------------------------
> 
> Here is the output when applying this chunk XSL through MSXML3(notice
> that there is no indentation):
> ---------------------------
> <var name="phones"><array length="2"><struct><var
> name="kind"><string>home</string></var><var name="phone"><string>(055)
> 123 4567</string></var></struct><struct><var
> name="kind"><string>palace</string></var><var name="phone"><string>(000)
> 000 0001</string></var></struct></array></var>
> ---------------------------
> 
> I'd like the output from the XSL to contain the indentation, but it
> doesn't. This XSL will only be applied using MSXML3 in the final
> product. How can I preseve this whitespace (indentation) in the output? 
> 
> Bruce
> 
> 
>  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
Keywords