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

  as HTML source output from XSLT - non breaking

Subject:   as HTML source output from XSLT - non breaking space to HTML
From: "Dave McRae" <Dave.McRae@xxxxxxxxxxxxxxxxx>
Date: Fri, 8 Apr 2005 10:44:09 +1000
html nbsp
Adam Knight proposed this question 2 months ago, (thread titled Using
&nbsp; in XSL HTML Output)

Please excuse me, I did not understand the answers, and, if any are used
in code, they do not achieve the desired affect.

The desired effect - a Table of Contents or list of Anchors, space
delimited.

Eg HTML source to look like
<a href="#sect1">Section1</a>&nbsp;<a href="#sect2">Section2</a>

The XSLT I use for that is

<xsl:output method="html" encoding="iso-8859-1" indent="yes"/>
..
<xsl:for-each select="section">
<a href="#{@Anchor}"><xsl:value-of select="@SectionName"/></a>{I wish to
output to HTML &nbsp;}
</xsl:for-each>

Replace {I wish to output to HTML &nbsp;} with..

&nbsp;
XSL Error: Reference to undefined entity 'nbsp'.

&amp;nbsp;
<a href="#sect1">Section1</a>&amp;nbsp;<a href="#sect2">Section2</a>
This outputs in text as &nbsp; not as the space desired

<![CDATA[&nbsp;]]>
<a href="#sect1">Section1</a>&amp;nbsp;<a href="#sect2">Section2</a>
This outputs in text as &nbsp; not as the space desired

&#32;
<a href="#sect1">Section1</a> <a href="#sect2">Section2</a>
No &amp; but it is a space - but not a &nbsp; (I cant have 2 spaces -
well, I can, but the HTML browser will display only 1)

&#38;nbsp
<a href="#sect1">Section1</a>&amp;nbsp;<a href="#sect2">Section2</a>
DAMN - how did it know to to map &#38 to &amp;


At the moment I have the space with a span so it may be styled up (with
CSS) for the extra width.
I have read the FAQ - and it is good - thanks all - and with that
section on special characters I can output tabs and special characters -
I just cannot output &nbsp; to the HTML client.

Can it be done?

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.