After a year of using stackoverflow I decided to join, but of course due to the fact that after a day of struggling I am stuck.My Problem: I am using javascript to build a document made of xml document, and stylesheet. This works well, (In Firefox, not at all in IE) for two of my cases but not the third.javascript========================================\[code\]function GetBookInfo(object){ try { var xmlCont=loadXMLDoc("files/books/"+object.id+"/META-INF/container.xml"); opfFile=xmlCont.getElementsByTagName("container")[0].getElementsByTagName("rootfiles")[0].getElementsByTagName("rootfile")[0].getAttribute("full-path"); xmlCont=loadXMLDoc("files/books/"+object.id+"/"+opfFile); xsl=loadXMLDoc("files/content.xsl"); displayXML(xmlCont, xsl, object.id); } catch (EventException) { alert(EventException.toString()); }}function displayXML(xmlIn, xslIn, place){ // code for IE if (window.ActiveXObject) { ex=xmlIn.transformNode(xslIn); document.getElementById(place).innerHTML=ex; } // code for Mozilla, Firefox, Opera, etc. else if (document.implementation && document.implementation.createDocument) { xsltProcessor=new XSLTProcessor(); xsltProcessor.importStylesheet(xslIn); resultDocument = xsltProcessor.transformToFragment(xmlIn,document); document.getElementById(place).appendChild(resultDocument); }}function loadXMLDoc(dname){ if (window.ActiveXObject) { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } } try { xhttp.open("GET",dname,false); xhttp.send(""); return xhttp.responseXML; } catch (EventException) { alert("Could not open: " +dname); } }\[/code\]javascript========================================xsl==============================================\[code\]<?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/package"> <html> <head> </head> <body> <div id="METADATA"> <p>Hello</p> <div id="title"> <xsl:value-of select='metadata/dc:title'/> </div> <br /> <div id="creator"> <xsl:value-of select='metadata/dc:creator'/> </div> <br /> <div id="publisher"> <xsl:value-of select='metadata/dcublisher'/> </div> <br /> <div id="language"> <xsl:value-of select='metadata/dc:language'/> </div> <br /> <div id="rights"> <xsl:value-of select='metadata/dc:rights'/> </div> <br /> <div id="subject"> <xsl:value-of select='metadata/dc:subject'/> </div> <br /> <div id="publicationDate"> <xsl:value-of select='metadata/dc:date[@opf:event="publication"]'/> </div> <br /> <div id="conversionDate"> <xsl:value-of select='metadata/dc:date[@opf:event="conversion"]'/> </div> <br /> <div id="source"> <xsl:value-of select='metadata/dc:source'/> </div> <br /> </div> </body> </html> </xsl:template> </xsl:stylesheet>\[/code\]xsl==============================================The xml file is a typical opf file found in an epub folder.opf(standard xml)==================================================\[code\]<?xml version='1.0' encoding='UTF-8'?><package xmlnspf="http://www.idpf.org/2007/opf" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="id"> <metadata> <dc:rights>Public domain in the USA.</dc:rights> <dc:identifier id="id" opf:scheme="URI">http://www.gutenberg.org/ebooks/1065</dc:identifier> <dc:creator opf:file-as="Poe, Edgar Allan">Edgar Allan Poe</dc:creator> <dc:title>The Raven</dc:title> <dc:language xsi:type="dcterms:RFC4646">en</dc:language> <dc:subject>Poetry, English</dc:subject> <dc:date opf:event="publication">1997-10-01</dc:date> <dc:date opf:event="conversion">2010-06-08T08:59:43.376234+00:00</dc:date> <dc:source>http://www.gutenberg.org/files/1065/1065-h/1065-h.htm</dc:source> <meta content="item5" name="cover"/> </metadata> <manifest> <item href="http://stackoverflow.com/questions/15708260/pgepub.css" id="item1" media-type="text/css"/> <item href="http://stackoverflow.com/questions/15708260/0.css" id="item2" media-type="text/css"/> <item href="http://stackoverflow.com/questions/15708260/1.css" id="item3" media-type="text/css"/> <!--Chunk: size=31062--> <item href="http://stackoverflow.com/questions/15708260/www.gutenberg.org@files@1065@[email protected]" id="item4" media-type="application/xhtml+xml"/> <item href="http://stackoverflow.com/questions/15708260/cover.jpg" id="item5" media-type="image/jpeg"/> <item href="http://stackoverflow.com/questions/15708260/toc.ncx" id="ncx" media-type="application/x-dtbncx+xml"/> </manifest> <spine toc="ncx"> <itemref idref="item4" linear="yes"/> </spine></package>\[/code\]opf(standard xml)==================================================Any help would be greatly appreciated.PS: If anyone knows why IE doens't display any of xsl created documents with error: "The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document."it would also help, thanks.