Loading XML with XSL and displaying it using AJAX
I'm quite stuck on loading and rendering XML document (needs to work on mozilla only), that needs to be transformed with XSL, using AJAX. I have come across an example, but it doesn't seem to work properly, as it overwrites all current content instead of placing XML data into a <P>. The example is bellow. 

    var xml = document.implementation.createDocument("", "", null);
    var xslt = document.implementation.createDocument("", "", null);

    //Set the async property on both documents to false so that they both completely load 
    //before any further processing is attempted.
    xml.async = false;
    xslt.async = false;

    //Load XML and XSLT documents into the XML DOM objects.
    xml.load("w3.xml");
    xslt.load("w3.xsl");

    //Create a new XSLTProcessor object and use its importStylesheet() method to import     the XSLT DOM object.
    var processor = new XSLTProcessor();
    processor.importStylesheet(xslt);

    //Transform the XML to a new XML DOM object with the transformToDocument() method of     the XSLTProcessor.
    var XmlDom = processor.transformToDocument(xml)

    //Create a new XMLSerializer and use it to serialize the new XML DOM object to a string.
    var serializer = new XMLSerializer(); 
    var output = serializer.serializeToString(XmlDom.documentElement);

    //The result can then be output to the innerHTML property of any element on the page.
    var outputDiv = document.getElementById("xmldata");
    outputDiv.innerHTML = output;

xmldata is the id of paragraph. The idea is to load XML document using AJAX by any means possible and then display it after it is transformed. There is no processing of the XML involved.


Loading XML with XSL and displaying it using AJAX
===

I'm quite stuck on loading and rendering XML document (needs to work on mozilla only), that needs to be transformed with XSL, using AJAX. I have come across an example, but it doesn't seem to work properly, as it overwrites all current content instead of placing XML data into a <P>. The example is bellow. 

    var xml = document.implementation.createDocument("", "", null);
    var xslt = document.implementation.createDocument("", "", null);

    //Set the async property on both documents to false so that they both completely load 
    //before any further processing is attempted.
    xml.async = false;
    xslt.async = false;

    //Load XML and XSLT documents into the XML DOM objects.
    xml.load("w3.xml");
    xslt.load("w3.xsl");

    //Create a new XSLTProcessor object and use its importStylesheet() method to import     the XSLT DOM object.
    var processor = new XSLTProcessor();
    processor.importStylesheet(xslt);

    //Transform the XML to a new XML DOM object with the transformToDocument() method of     the XSLTProcessor.
    var XmlDom = processor.transformToDocument(xml)

    //Create a new XMLSerializer and use it to serialize the new XML DOM object to a string.
    var serializer = new XMLSerializer(); 
    var output = serializer.serializeToString(XmlDom.documentElement);

    //The result can then be output to the innerHTML property of any element on the page.
    var outputDiv = document.getElementById("xmldata");
    outputDiv.innerHTML = output;

xmldata is the id of paragraph. The idea is to load XML document using AJAX by any means possible and then display it after it is transformed. There is no processing of the XML involved.

