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

RE: space between two prints ?

Subject: RE: space between two prints ?
From: Jeff Beadle <Jbeadle@xxxxxxxx>
Date: Wed, 5 Dec 2001 13:54:12 -0500
xsl print space nbsp
Hey Radek,

If you're ouput (x)html you could use a !DOCTYPE definition at the top of
your xsl document, like this ...

<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [<!ENTITY nbsp "&#160;">]>
<xsl:stylesheet ...>
...

<xsl:value-of select="../HEADER/FROM/CITY"/>,&nbsp;<xsl:value-of
select="../HEADER/FROM/STATE"/>
<xsl:value-of select="../HEADER/FROM/ZIP1"/>

...
</xsl:stylesheet>


-Jeff






-----Original Message-----
From: Stuart Celarier [mailto:stuart@xxxxxxxxxxx]
Sent: Wednesday, December 05, 2001 1:52 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  space between two prints ?


Radek,

You can use an <xsl:text> element to introduce a (real) space character:

<xsl:value-of select="../HEADER/FROM/STATE"/>
<xsl:text> </xsl:text>
<xsl:value-of select="../HEADER/FROM/ZIP1"/>

or

<xsl:value-of select="../HEADER/FROM/STATE"
/>&#x20;<xsl:value-of select="../HEADER/FROM/ZIP1"/>

or you can insert a non-breaking space character (&nbsp; in HTML) if that is
more appropriate:

<xsl:value-of select="../HEADER/FROM/STATE"
/>&#160;<xsl:value-of select="../HEADER/FROM/ZIP1"/>

For more information on why the white space was removed in your example,
read up on white space handling, e.g., in [1].

Cheers,
Stuart, stuart@xxxxxxxxxxx, www.ferncrk.com

Reference
[1] Kay, Michael, "XSLT Programmer's Reference, Second Edition", Wrox Press,
2001. See p. 139, f.

-----Original Message-----
I would like to hardcode one character space between state and zip ...
how can I do that ? I didn't find solution for that simple task yet...

<xsl:value-of select="../HEADER/FROM/CITY"/>, <xsl:value-of
select="../HEADER/FROM/STATE"/>
<xsl:value-of select="../HEADER/FROM/ZIP1"/>

appreciate any sugesstion,
Radek



 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

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.