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

RE: How to put space between two characters?

Subject: RE: How to put space between two characters?
From: Pieter Reint Siegers Kort <pieter.siegers@xxxxxxxxxxx>
Date: Tue, 6 Apr 2004 10:15:58 -0500
html non braking space
Hi puja,

I just realized that your original question was to put space between words,
while the answers (including mine) were focused on images...

Anyway, although you can, there is no real need to use DOCTYPE, you simply
use &#160; (which is output to the non-braking-space &nbsp; equivalent) in
your XSL Stylesheet to separate whatever HTML elements, like this:

<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:output method="html" encoding="UTF-8" indent="yes" />

<xsl:template match="/run">
	<html>
	<head>
	<title>Title</title>
	</head>
	<body>
	<img src="C:\Documents and
Settings\psiegers\Desktop\pietsiegs.jpg"></img>
	&#160;&#160;
	<img src="C:\Documents and
Settings\psiegers\Desktop\pietsiegs.jpg"></img>
	</body>
	</html>
</xsl:template>

</xsl:stylesheet>

Alternativley, you can use a HTML table, set the border to '0', and play
with the clellspacing attribute of the <td> elements, like this:

<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:output method="html" encoding="UTF-8" indent="yes" />

<xsl:template match="/run">
	<html>
	<head>
	<title>Title</title>
	</head>
	<body>
	<table border="0" cellspacing="10">
	<tr>
	<td>
		<img src="C:\Documents and
Settings\psiegers\Desktop\pietsiegs.jpg"></img>
	</td>
	<td>
		<img src="C:\Documents and
Settings\psiegers\Desktop\pietsiegs.jpg"></img>
	</td>
	</tr>
	</table>
	</body>
	</html>
</xsl:template>

</xsl:stylesheet>

But note that this approach gives you 10 pixels AROUND the whole image, an
effect you may not wish to use.

A final approach (IMO, the best) that makes use of both techniques is to use
a <table> element and add another <td> element between the two <img>
elements, and fill it with the amount of non-breaking spaces like this:

<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:output method="html" encoding="UTF-8" indent="yes" />

<xsl:template match="/run">
	<html>
	<head>
	<title>Title</title>
	</head>
	<body>
	<table border="0">
	<tr>
	<td>
		<img src="C:\Documents and
Settings\psiegers\Desktop\pietsiegs.jpg"></img>
	</td>
	<td>&#160;&#160;&#160;&#160;</td>
	<td>
		<img src="C:\Documents and
Settings\psiegers\Desktop\pietsiegs.jpg"></img>
	</td>
	</tr>
	</table>
	</body>
	</html>
</xsl:template>

</xsl:stylesheet>

Please let us know if this answers your questions.

Cheers, Pieter  


<prs/>
http://www.pietsieg.com
http://www.pietsieg.com/dotnetnuke
Contributor on www.ASPToday.com
Co-author on "Professional ASP.NET XML with C#", July 2002 by Wrox Press

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.