Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes XML and Related Technologies and the fly likes What is the equivalent of using   in XSL transformation ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "What is the equivalent of using   in XSL transformation ?" Watch "What is the equivalent of using   in XSL transformation ?" New topic
Author

What is the equivalent of using   in XSL transformation ?

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

Hi All,

I'm using Xalan for transforming a XML to a HTML usng a XSL. I need to build a table pulling the data from XML and sometimes there may not be any data to be filled in a table. In such cases, a space needs to be displayed. My problem here is, as and when there is no data to be displayed, it is also loosing the boundary (border) of the <td> element.

To be more precise,



As you can understand, my intention is to have a data displayed in <td> element, if available, otherwise nothing to display. This is not my problem, but when no data to display, it is also loosing boundary or border.

In plain HTML,

we can use   for this purpose, obviously this does not work in XML. But the equivalent #160; is also not working. How to do I get this done. Any advice.


Regards
KumarRaja

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

huh,

I was able to find some work around for this, by declaring a variable holding   and then read the variable where ever I needed. But I'm not liking it. XSL spec might have already provided some decent solution for this. Any idea.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What is the equivalent of using &nbsp; in XSL transformation ?
 
Similar Threads
convert &amp;amp; to &
NBSP in Html output
Newbie Question---Help?
displaying image in any browser using xsl
Newbie problem with XSLT