How to make a whitespace in XSL?

Matt (archive)

Usenet Archive
Joined
Jan 13, 2000
Messages
739
Reaction score
0
In XSL, if I want to make a whitespace, I put   but not work. How to make a space??

The following won't create any spaces. It will output mytitlemyauthor

<xsl:value-of select="title"> <xsl:value-of select="author">

But the following will output mytitle++myauthor:
<xsl:value-of select="title">++<xsl:value-of select="author">

any ideas? please advise. thanks!!
 

David Carlisle

Usenet Archive
Joined
Jan 5, 2000
Messages
609
Reaction score
0
<xsl:text> </xsl:text>

will make three spaces.

You mentioned nbsp which is the html entity for non breaking space. that's character 160 so you could use <xsl:value-of select="title">   <xsl:value-of select="author"> to get that (which would most likely be serialised using the nbsp entity in html output)

Note however calling nbsp white space is rather misleading, it explictly is not white space according to both the xML and HTML recommendations. It is not allowed in places "whitespace" is allowed (such as between attributes, or to indent elements in element-only content).

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,224
Members
248,132
Latest member
henrywalsh

Latest Threads

Top