Missing borders on an empty cell
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Wed Nov 04, 2015 6:31 pm
Missing borders on an empty cell
Code: Select all
<td class="borderDotName">
<xsl:value-of select="Label1"/>
</td>
If the "Label1" value in the XML is not empty then the cell looks OK in the browser. But if it is empty and have no text, then the borders of my cell are missing. How can I handle empty cells?
Thanks.
Andrew
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Missing borders on an empty cell
Hi Andrew,
It probably depends on how the final HTML content looks like in the case of the missing value.
If the final HTML has the table cell looking like this: <td/> web browsers might have problems with it.
Ideally you could set <xsl:output method="html"/> in your XSLT stylesheet or add an XML comment inside the XSLT like:
to avoid having in the final HTML the <td> serialized in the short <td/> form.
More about this here:
http://www.w3.org/TR/xhtml1/guidelines.html
Regards,
Radu
It probably depends on how the final HTML content looks like in the case of the missing value.
If the final HTML has the table cell looking like this: <td/> web browsers might have problems with it.
Ideally you could set <xsl:output method="html"/> in your XSLT stylesheet or add an XML comment inside the XSLT like:
Code: Select all
<td class="borderDotName">
<xsl:choose>
<xsl:when test="$Label1">
<xsl:value-of select="$Label1"/>
</xsl:when>
<xsl:otherwise>
<xsl:comment>Empty CEll</xsl:comment>
</xsl:otherwise>
</xsl:choose>
</td>
More about this here:
http://www.w3.org/TR/xhtml1/guidelines.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service