src/xslt.js
function xsltPassThrough(input, template, output, outputDocument) {
    if (template.nodeType == DOM_TEXT_NODE) {
        if (xsltPassText(template)) {
            let node = domCreateTextNode(outputDocument, template.nodeValue);
            domAppendChild(output, node);
        }

    } else if (template.nodeType == DOM_ELEMENT_NODE) {
        let node = domCreateElement(outputDocument, template.nodeName);

        for (const a of template.attributes) {
            if (a) {
                const name = a.nodeName;
                const value = xsltAttributeValue(a.nodeValue, input);
                domSetAttribute(node, name, value);
            }
        }

        domAppendChild(output, node);
        xsltChildNodes(input, template, node);
    } else {
        // This applies also to the DOCUMENT_NODE of the XSL stylesheet,
        // so we don't have to treat it specially.
        xsltChildNodes(input, template, output);
    }
}
function xsltPassThrough(input, template, output, outputDocument) {
    if (template.nodeType == DOM_TEXT_NODE) {
        if (xsltPassText(template)) {
            let node = domCreateTextNode(outputDocument, template.nodeValue);
            domAppendChild(output, node);
        }

    } else if (template.nodeType == DOM_ELEMENT_NODE) {
        let node = domCreateElement(outputDocument, template.nodeName);

        for (const a of template.attributes) {
            if (a) {
                const name = a.nodeName;
                const value = xsltAttributeValue(a.nodeValue, input);
                domSetAttribute(node, name, value);
            }
        }

        domAppendChild(output, node);
        xsltChildNodes(input, template, node);
    } else {
        // This applies also to the DOCUMENT_NODE of the XSL stylesheet,
        // so we don't have to treat it specially.
        xsltChildNodes(input, template, output);
    }
}
function xsltPassThrough ( input , template , output , outputDocument ) { if ( template . nodeType == DOM_TEXT_NODE ) { if ( xsltPassText ( template ) ) { let node = domCreateTextNode ( outputDocument , template . nodeValue ) ; domAppendChild ( output , node ) ; } } else if ( template . nodeType == DOM_ELEMENT_NODE ) { let node = domCreateElement ( outputDocument , template . nodeName ) ; for ( const a of template . attributes ) { if ( a ) { const name = a . nodeName ; const value = xsltAttributeValue ( a . nodeValue , input ) ; domSetAttribute ( node , name , value ) ; } } domAppendChild ( output , node ) ; xsltChildNodes ( input , template , node ) ; } else { // This applies also to the DOCUMENT_NODE of the XSL stylesheet, // so we don't have to treat it specially. xsltChildNodes ( input , template , output ) ; } }
Passes template text to the output. The current template node does not specify an XSL-T operation and therefore is appended to the output with all its attributes. Then continues traversing the template node tree.
Passes template text to the output . The current template node does not specify an XSL - T operation and therefore is appended to the output with all its attributes . Then continues traversing the template node tree .