• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

NBSP in Html output

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Similar question was asked here: https://coderanch.com/t/125062/XML/add-nbsp-XSL-rule
HTH
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mapraputa Is:
HTH


HTH means ?
 
Mapraputa Is
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HTH = Hope This Helps
 
Tim Voet
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic