Return to Snippet

Revision: 17588
at September 10, 2009 03:16 by manatlan


Initial Code
function xslt(xmlDoc,xslDoc) {
    var transform;
    
    if (typeof ActiveXObject != 'undefined') {
        transform = xmlDoc.transformNode(xslDoc);
    }
    else {
        var xsl = new XSLTProcessor();
        
        xsl.importStylesheet(xslDoc);
        var fragment=xsl.transformToFragment(xmlDoc, document);
        if( fragment.childNodes.length>0 )
          transform = fragment.childNodes[0].innerHTML;
        else
            alert("error");
    }
    return transform;
}

Initial URL

                                

Initial Description

                                

Initial Title
javascript xslt transformation

Initial Tags
javascript, xml

Initial Language
JavaScript