[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: how to force start and end tags
Subject: Re: how to force start and end tags
From: Paul DuBois <paul@xxxxxxxxxxxx>
Date: Fri, 28 Nov 2003 12:13:02 -0600
|
At 9:34 -0800 11/28/03, Tassos Anastasiou wrote:
Hi all,
I have the following simple XSL:
<xsl:template match="para">
<xsl:element name="p">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
and appropriate templates to handle <row> and <entry>
The following XML fragment
<row>
<entry>
<para></para>
</entry>
<entry>
<para></para>
</entry>
<entry>
<para></para>
</entry>
</row>
generates the following XHTML:
<tr>
<td>
<p />
</td>
<td>
<p />
</td>
<td>
<p />
</td>
</tr>
I am using XMLSpy. Any idea why it's writing <p/> instead of <p></p>
when the <para> element has no content? It works fine when it has content.
I understand that <p /> is valid XHTML but unfortunately IE doesn't seem
to render it correctly (the table row doesn't show). Is there a way to
force it to write <p></p> instead of just <p/>?
What do you mean by "doesn't show"? (And do you really mean "cell doesn't
show" rather than "row doesn't show"?)
If you mean something like, "the cell borders don't show in a bordered
table when the cell has no content," then this isn't necessarily specific
just to IE. Other browsers exhibit this behavior as well. You can generally
force them to display a border by writing into the cell. In
your stylesheet, you could do this if the content of the para is empty
(or perhaps better, if normalize-space() of the para content is empty).
Thnaks,
--tassos
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
RSS 2.0 |
|
Atom 0.3 |
|
|