[xsl] generating broken html?

Subject: [xsl] generating broken html?
From: Francis Norton <francis@xxxxxxxxxxx>
Date: Fri, 23 Nov 2001 12:14:36 +0000
Hi,

I'm trying to reformat a substantial dreamweaver-generated HTML file by using tidy to clean it up and convert it to XML, and then the following trivial transform:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<xsl:copy-of select="." />
</xsl:template>
</xsl:stylesheet>


to turn it back into nicely indented HTML.

When I do this transform using msxsl.exe with any version of msxml (3.0 or 4.0) the HTML is beautifully indented but doesn't work with IE5.5. The problems I've identified so far are to do with closing empty elements that are perhaps not normally empty - eg:

<script type="text/javascript" language="Javascript" src="shared/js/userconfig1.js"/>

and

<div class="titlebar" id="titlebar"/>

- both of these need to be closed as

></script>

and

></div>

to work.

Once I've fixed these the browser no longer shows as blank, but I still can't see any text.

Saxon gives me working HTML but the indentation is not as pretty and is so different (eg line breaks) that it is very hard to diff the two.

Has anyone had similar problems, and if so did they come up with an msxsl solution or did they find another xslt processor which could do similar indenting?

Francis.



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


Current Thread