Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


msxsl.exe 3.0 disagrees with IE 6.0 over simple XSL

From: "Phlip" <phlip_cpp@-----.--->
To: 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




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