Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xsl and document.write

Status
Not open for further replies.

ericjohnsus

Technical User
Mar 12, 2003
1
US
The XSL works fine when it is part of the XML file, however, I only get a partial rendering when I run it through this method. I use IE6 with MSXML3, so I am unclear as to why I have a problem. Does this subject my xsl to a more rigorous parsing process?

<html>
<script src=&quot;dscript106/xtools.js&quot; type=&quot;text/javascript&quot;>
<!--
function publishDoc (xmlData, xslTemplate)
{
// Load XML
var xml = new ActiveXObject(&quot;Msxml2.DOMDocument&quot;)
xml.async = false
xml.load(xmlData)
// Load the XSL
var xsl = new ActiveXObject(&quot;Msxml2.DOMDocument&quot;)
xsl.async = false
xsl.load(xslTemplate)
// Transform
document.write(xml.transformNode(xsl));
}
-->

</script>

<body onLoad = &quot;publishDoc('xmlFile.xml', 'xslTemplate.xsl');&quot;>

</body>

</html>

The XML version that works starts like this:

<!DOCTYPE xmlFile SYSTEM &quot;xmlFile.dtd&quot;>
<?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;xslTemplate.xsl&quot;?

And the XSL lines look like this:

<xsl:stylesheet xmlns:xsl=&quot; version=&quot;1.0&quot;>
<xsl:eek:utput method=&quot;html&quot; omit-xml-declaration=&quot;no&quot; indent=&quot;no&quot;/>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top