Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 23rd, 2003, 03:13 AM
Registered User
 
Join Date: Oct 2003
Location: , , .
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>

Reply With Quote
  #2 (permalink)  
Old October 23rd, 2003, 05:58 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
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)
Reply With Quote
  #3 (permalink)  
Old October 23rd, 2003, 08:42 AM
Registered User
 
Join Date: Oct 2003
Location: , , .
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"...

Reply With Quote
  #4 (permalink)  
Old October 23rd, 2003, 09:25 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Nor Hachin, Kotayk, Armenia.
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
Reply With Quote
  #5 (permalink)  
Old October 23rd, 2003, 11:26 AM
Registered User
 
Join Date: Oct 2003
Location: , , .
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.

Reply With Quote
  #6 (permalink)  
Old October 23rd, 2003, 12:05 PM
Registered User
 
Join Date: Oct 2003
Location: , , .
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> :)

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:58 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.