This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NBSP in Html output

 
Tim Voet
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone. Its been a while since i have been on the forum, its good to be back.
here is my question. I am getting into XSL, and XSLT transformations...
i am having a problem when i put my XML through my transformer. when it generates my Html output, i would like to put a non-breaking space intead of a null value. The null value is very ugly to look at when you open the Html in a browser.
does anyone have a suggestion or a trick that i am missing.
thanks
Tim
 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Similar question was asked here: http://www.coderanch.com/t/125062/XML/add-nbsp-XSL-rule
HTH
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mapraputa Is:
HTH

HTH means ?
 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTH = Hope This Helps
 
Tim Voet
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that isn't quite want i want to know. I had found that post when i did a search. what i want is more something like this

and what i want to do is when one of the value-of return values returns null, i want to put a B]& nbsp ;[/B] in the html.
for this reason i don't think that the entity reference will help. My output is generated completely, but to anyone who has ever worked with HTML, will know that if you don't put a blank space in a empty table cell, the border does not show around that cell, and screws up the look of the page.
thanks anyways for the direction you pointed me in.
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use xsl:if or xsl:choose,xsl:when for testing conditions.
for example

this will avoid borderless table or something.
[ July 10, 2002: Message edited by: Mapraputa Is ]
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Map & Micheal,
There is some error is UBB code on using [ code ] tag..
I think this is not solved in JLive forum also
 
Tim Voet
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the input.
does this mean i should code a function for normalize-space?? or is this an already supported feature.
I really appreciate the help.
Tim
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its already supported feature,just try to use it in ur code.
 
Tim Voet
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks.
will try it tonight when i get home.
Tim
 
Tim Voet
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Balaji.
it works....i had forgot that i had put my code on my FTP Server.
thanks for your help everyone.
Tim
 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Balaji, what do you mean "There is some error is UBB code on using [ code ] tag.." - smiles on XSL tags? I turned off smiles in your post.
Tim, if yu do not mind extra blank after your data, you probably can just put &nbsp after <xsl:value-of="..."/>
[ July 10, 2002: Message edited by: Mapraputa Is ]
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Sorry,I'm so stupid,forgot to turn off the smiles.Thanks.
Originally posted by Mapraputa Is:
smiles on XSL tags? I turned off smiles in your post.
[ July 10, 2002: Message edited by: Mapraputa Is ]
 
Tim Voet
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your help both of you.....i tried putting the space after everything, and it looked ok, but i wanted to try the other method to see, and it worked well.
thanks again...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic