Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: msxsl.exe 3.0 disagrees with IE 6.0 over simple XSL msxsl.exe 3.0 disagrees with IE 6.0 over simple XSLTo: NULL Date: 7/5/2005 6:06:00 PM XSLers:
Consider this dirt-simple, tutorial-level XSL:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml"
media-type="text/html"
standalone="no"
omit-xml-declaration="yes"
encoding="UTF-8" />
<xsl:template match="/attitude">
<html>
<head></head>
<body bgcolor="#ffffff">
<ul>
<xsl:for-each select="*">
<li>
<xsl:value-of select="@title" />
<ul>
<xsl:for-each select="property">
<li>
<xsl:value-of select="@name" />
</li>
</xsl:for-each>
</ul>
</li>
</xsl:for-each>
</ul>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
We obviously need to turn this simple XML into XHTML:
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="format.xslt" ?>
<attitude>
<concept title="Doberman">
<property name="Poodle" />
<property name="Terrier" />
</concept>
<concept title="Hooded">
<property name="Blue" />
<property name="Brown" />
<property name="Norway" />
</concept>
</attitude>
When I run that thru MSXSL.EXE (and Tidy -i), it produces this:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
</head>
<body bgcolor="#FFFFFF">
<ul>
<li>Doberman
<ul>
<li>Poodle</li>
<li>Terrier</li>
</ul>
</li>
<li>Hooded
<ul>
<li>Blue</li>
<li>Brown</li>
<li>Norway</li>
</ul>
</li>
</ul>
</body>
</html>
A beautiful XHTML page containing nested lists.
However, when I load that sample XML inside IE, it doesn't render beautiful
nested frames. It renders an ugly little snip that looks like it came from
<ul><li><ul><li></li></ul></li></ul>. Nothing else. It's as if the
transformation started, and died when it encountered output text.
The first thing to check is the transclusion tags. So is this correct in the
XML input file??
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="format.xslt" ?>
Note that format.xslt is local, in a file in the same folder. It's not on a
server. Would that matter? (I would prefer not to serve the XSLT because the
rest of the program is an HTML GUI without a server.)
So are the tags to declare the XSLT as outputing XHTML correct?
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml"
media-type="text/html"
standalone="no"
omit-xml-declaration="yes"
encoding="UTF-8" />
--
Phlip
http://www.c2.com/cgi/wiki?ZeekLand
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
