XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Lauren McDonaldSubject: Trying to add spaces between variables
Author: Lauren McDonald
Date: 03 May 2007 12:06 PM
Hi all, I'm trying to add spaces between variables, and it does not seem to be working. I'm making mailing labels that are generated as a pdf document which then can be printed on a sheet of mailing labels. Here in Canada the specifications are that the city, province, and postal code are to be on one line with a space between city and province, and two spaces between province and the postal code. The most I can get between the province and the postal code is one space. Can anyone help me?
CITY, PROV, and POSTAL are XML nodes.
Here is my code:
<fo:block>
<xsl:variable name="newcity">
<xsl:value-of select="concat(CITY,' ')"/>
</xsl:variable>
<xsl:variable name="newprov">
<xsl:value-of select="concat(PROV, ' ', ' ')"/>
</xsl:variable>
<xsl:value-of select="$newcity"/><xsl:value-of select="$newprov"/><xsl:value-of select="POSTAL"/>
</fo:block>
end of code

If you need a better explaination let me know.

Lauren

Postnext
Elias HuterSubject: Trying to add spaces between variables
Author: Elias Huter
Date: 04 May 2007 04:09 AM
Hi,

it's just a guess, but maybe it's a display issue of your browser? Try to right click and chose "View Source" to be sure that there is only one space, or use the "Preview Text" option in stylus studio after choosing "Preview Result".

Regards
Elias

Postnext
Lauren McDonaldSubject: Trying to add spaces between variables
Author: Lauren McDonald
Date: 04 May 2007 10:47 AM
Originally Posted: 04 May 2007 10:46 AM
It's the browser, Preview Results --> Preview Text shows two spaces, but the Preview in Browser option only shows one space. Is there anything that I can do to change this?

Postnext
Tony LavinioSubject: Trying to add spaces between variables
Author: Tony Lavinio
Date: 04 May 2007 01:06 PM
HTML always collapses consecutive whitespace (including linefeeds and
tabs) to a single space. Unless...

It depends how you are actually rendering the FO. Since you haven't
shown us everything, we're guessing there is more to it, and that the
actual problem doesn't lie within what you've shown.

In HTML, if you want space to be preserved you need to either wrap
it in a special element like <PRE></PRE> or change it to &#160; (&nbsp;)

Posttop
Lauren McDonaldSubject: Trying to add spaces between variables
Author: Lauren McDonald
Date: 04 May 2007 01:12 PM
The &#160; worked. Thanks everyone!

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.