Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: BUG: .NET XSLT transform xml -> html w/indent option

From: "Oleg Tkachenko [MVP]" <oleg@--!----!---------------.--->
To: NULL
Date: 2/3/2005 12:40:00 PM
bentt2000 wrote:

> This slight difference causes serious visual anomalies in the resultant 
> HTML. I have tried for several days to make the <img> stay on the same line 
> as the <td> tag to no avail. Any help here? I took the XML source and linked 
> it with the XSL stylesheet and opened it manually in Internet Explorer 6. In 
> Internet Explorer 6, the XSL stylesheet renders perfectly and no visual 
> anomalies appear.
> 
> Is this a known issue/bug? If so, I'm all ears for any alternative solution. 
> I have tried "indent=no" but this appears to randomly break up the HTML at 
> unpredictable places and thus I don't feel it is "reliable" in its results.

Yeah, seems to be a bug. According to XSLT spec, indentation shouldn't 
change HTML rendering behaviour. And MSXML does output <td><img> even 
when indenting. I'll file the bug.
The only option therefore seems to be disabling automatic indentation. 
You can keep your stylesheet's indentaion using xml:space attribute though:

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output method="html" version="4.0" indent="no"/>
   <xsl:template match="/">
     <html xml:space="preserve">
       <body>
         <table cellpadding="0" cellspacing="0" border="0">
           <tr>
             <td><img src="spacer.gif"/></td>
           </tr>
         </table>
       </body>
     </html>
   </xsl:template>
</xsl:stylesheet>


-- 
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent