First, excuse my possible lack of proper terminology - I only started working with XML/XSL several days ago. I'm using PHP 4.0.6 on Windows 2000 running apache 1.3.20. I'm using expat and sablotron for my XML/XSLT parsing and translation.
This problem is quite significant and obvious to me; I have constructed numerous examples and caused it to manifest itself in multiple ways. Here's a simple example.
If an XSL template is defined for an XML tag; say, bold; and I want to apply other templates to text within the bold text (not too uncommon, probably) I'd write the following:
<xsl:template match="bold">
<B>
<xsl:apply-templates/>
</B>
</xsl:template>
If the XML document contains <bold></bold> (no text between them) or <bold/>, the <B> will show up in the HTML but not the </B>. This presents little problem for people using bold, as no one should be using bold tags with nothing between them. But when it's applied to a bigger problem, say, a giant formatted table of employee data (some of which is empty), it would cause malformed HTML (at best) or make the page unviewable (at worst).
I have tried this on my own setup as well as using Java's transformer class on Jakarta/Tomcat, and it has the same effect. Is this a problem with the standard, or do both of these use the same transformation software? or is the same bug present in both? Does anyone have any answers?
Jason
P.S. I have posted the code for this test case (including my PHP test page) at www.percarus.com/php/ in a file called transform.zip.