xsl-list
[Top] [All Lists]

RE: tag minimisation

2002-09-11 03:05:23

DC:
so you need to make th elast stage in your pipeline convert to html.
Just sending XML not using /> will cause IE to break in other places
every <br></br> will cause a blank line (ie two line breaks) for
example.

The easiest way to do an xhtml to html trasform for IE is to stick

<?xml-stylesheet type="text/xsl" href="idenity.xsl"/>

at the top of the file, where identity.xsl is an XSL identity 
transform
outputting using html outputmethod.
 
Yeah, this works.  Very cunning.  However, its an extra level of
processing and.. well, it just seems like overkill.  Very good though.


yes it does what you need, not what you are asking for: it 
outputs <br/>
as <br /> not <br></br>.


<br>'s aren't the problem, nor are <a> or <img>, as these generally
don't have styles.  The problem lies squarely with <div> <span> <td>
etc, getting minimised:

<td><xsl:apply-templates select="foo"/></td>
<td>bar</td>

Becomes, when <foo> is empty/not present:

<td/>
<td>bar</td>

which is then interpreted as:

<td>
  <td>bar</td>
</td>

which is incorrect.  The current realistic solution (no node-tests pls)
is to include some whitespace, to prevent the serialiser minimising the
element, so the output becomes:

<td> </td>
<td>bar</td>

All I was asking for was a switch to tell the serialiser not to bother
minimising empty elements.

cheers
andrew

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.385 / Virus Database: 217 - Release Date: 04/09/2002
 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>