Blank cells XML / XSL

R

RigasMinho

I have a table that is made in XSL that grabs the information from an
XML sheet.

However any cell that is blank in XML the border doesnt show up when
you view it.

Is there a work around for this?

For example in my XML file i have:
<test title='information 1'> text cell 1</test>
<test title='information 2'> </test>


this will produce a cell that has a border with "text cell" in it but
for the blank cell there is no border.

Thanks
 
M

Martin Honnen

RigasMinho said:
I have a table that is made in XSL that grabs the information from an
XML sheet.

this will produce a cell that has a border with "text cell" in it but
for the blank cell there is no border.

Is that a HTML table? Then CSS 2 can help with e.g.

<style type="text/css">
table { empty-cells: show; }
</style>

Or put   into those cells where you XML does not provide any
contents e.g.
<td> </td>
 
R

RigasMinho

I tried to do the table empty-cells: show but still it doesnt show the
empty cells.

I just want to produce the border around an empty cell.
I have this which go through the xml file and searches for the data to
pass into each table row.

<xsl:for-each select="//infoObject">
<tr><xsl:for-each select="infoObjectDetail">
<td><xsl:value-of select="." /> </td>

I tried using:
<td> </td>
but have yet to figure out where to place this.

I'll keep on working on it and if i come up with a solution i'll let
you know - if not that is fine as well.
 
J

Joseph Kesselman

It sounds like the first thing you need to do is figure out what you
want the output document to be. That's an HTML problem, and should be
debugged by hand-editing HTML until it works the way you intended.

After that, writing XSLT to produce that HTML from XML should be
straightforward.

Solve one problem at a time.
 
M

Martin Honnen

RigasMinho wrote:

<xsl:for-each select="//infoObject">
<tr><xsl:for-each select="infoObjectDetail">
<td><xsl:value-of select="." /> </td>

I tried using:
<td> </td>
but have yet to figure out where to place this.

Alike this
<xsl:for-each select="infoObjectDetail">
<td>
<xsl:choose>
<xsl:when test="normalize-space() != ''">
<xsl:value-of select="."/>
</xsl:when>
<xsl:eek:therwise><xsl:text> </xsl:text></xsl:eek:therwise>
</xsl:choose>
</td>
</xsl:for-each>
 
R

RigasMinho

I got it:
<xsl:for-each select="//infoObject">
<tr><xsl:for-each select="infoObjectDetail">
<td><xsl:value-of select="." />  </td>
</xsl:for-each>
</tr>
</xsl:for-each>
Thanks i would never have figured out the &#160
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,006
Messages
2,570,265
Members
46,860
Latest member
JeremiahCo

Latest Threads

Top