Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 23rd, 2003, 03:13 AM
Registered User
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default I gotta be missing something...

Using a trasform, all I want to do is have html format that actually has the text " " or "#160;". I.e. given:

<xmldata>Joe</xmldata>

I want a transform that gives me a result exactly like this:

<html><body><p>Dear#160;#160;Joe</p></body></html>

 
Old October 23rd, 2003, 05:58 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

This is not easy to do without dubious features such as disable-output-escaping although you could try an escaped ampersand (ampersand amp semi-colon) and then #160;. Why bother though? If you use ampersand hash 160 semi-colon in your stylesheet it will output a non-breaking space that should work in the browser.

Joe (MVP - xml)
 
Old October 23rd, 2003, 08:42 AM
Registered User
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have to get the exact characters below because the final target is not a browser, but rather MS Word...and MS Word seems the ignore the non-breaking spaces that the browser does recognize. I've tried escaping the ampersand but then, of course, Word shows the literial characters #160; in the result....

This is driving me nuts...a client simply want's two spaces between sentences and I can't stomach telling them "I can't do that"...

 
Old October 23rd, 2003, 09:25 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to armmarti
Default

Ok,

As Joe mentioned, using disable-output-escaping mechanism is risky, since the XSLT specification doesn't enforce implementations (XSLT engines) to support the mechanism. However, to output two consecutive nb spaces, write:
Code:
<xsl:text disable-output-escaping="yes">&amp;#160;&amp;#160;</xsl:text>
Regards,
Armen
 
Old October 23rd, 2003, 11:26 AM
Registered User
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yeeha...that worked and I going with it! Thanks!! I'm so embarassed at getting stuck on this.

 
Old October 23rd, 2003, 12:05 PM
Registered User
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

for your entertainment, I was about to go with:

<span style="color:white">__</span> :)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there some ':, missing ??? saban SQL Server ASP 1 May 28th, 2007 06:32 AM
What is missing? grstad SQL Language 11 March 6th, 2006 01:53 AM
MISSING TDs cleytonjordan Javascript How-To 3 July 29th, 2005 10:12 AM
what am i missing? m002864 Crystal Reports 0 July 6th, 2004 07:24 AM
Missing sp_Accounts_GetPermissionDetails Dennis0656 BOOK: ASP.NET Website Programming Problem-Design-Solution 3 May 10th, 2004 10:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.