alabast
01-23-2010, 07:01 PM
I've got an AJAX page that is transforming responseXML using an xsl stylesheet using (in IE) the transformNode function (firefox uses an XSLTProcessor). Problem is IE is throwing an error "The stylesheet does not contain a document element"; it doesn't seem to think the document is well-formed. The page works fine in firefox.
I can't find the problem, but here's the whole xsl document. If someone knows something I don't, I'd appreciate it some help.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "*">
<!ENTITY copy "©">
<!ENTITY reg "®">
<!ENTITY trade "™">
<!ENTITY mdash "—">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY pound "£">
<!ENTITY yen "¥">
<!ENTITY euro "€">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" />
<xsl:variable name="pageid">
<xsl:value-of select="/main/@id" />
</xsl:variable>
<xsl:template match="/">
<div class="pageMenu">
<xsl:for-each select="main/listing" >
<div style="background:#fff; cursor:pointer;" class="pageMenuOption" onclick="loadXML('{$pageid}','{@id}')">
<xsl:value-of select="@name" />
</div>
</xsl:for-each>
<div id="pageContent" class="pageContent">
Select a hero!
</div>
</div>
</xsl:template>
<xsl:template match="/main/listing">
<h3><xsl:value-of select="@name" /></h3>
<xsl:value-of select="/main/listing" />
<div id="illustration" class="illustration"><img src="images/{@id}_heroic.jpg" /></div>
</xsl:template>
</xsl:stylesheet>
I can't find the problem, but here's the whole xsl document. If someone knows something I don't, I'd appreciate it some help.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "*">
<!ENTITY copy "©">
<!ENTITY reg "®">
<!ENTITY trade "™">
<!ENTITY mdash "—">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY pound "£">
<!ENTITY yen "¥">
<!ENTITY euro "€">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" />
<xsl:variable name="pageid">
<xsl:value-of select="/main/@id" />
</xsl:variable>
<xsl:template match="/">
<div class="pageMenu">
<xsl:for-each select="main/listing" >
<div style="background:#fff; cursor:pointer;" class="pageMenuOption" onclick="loadXML('{$pageid}','{@id}')">
<xsl:value-of select="@name" />
</div>
</xsl:for-each>
<div id="pageContent" class="pageContent">
Select a hero!
</div>
</div>
</xsl:template>
<xsl:template match="/main/listing">
<h3><xsl:value-of select="@name" /></h3>
<xsl:value-of select="/main/listing" />
<div id="illustration" class="illustration"><img src="images/{@id}_heroic.jpg" /></div>
</xsl:template>
</xsl:stylesheet>