How can I use JavaScript to transform XML & XSLT?

前端 未结 5 1405
轻奢々
轻奢々 2020-11-29 04:24

I want to use JavaScript to show my XSLT, but on my server nothing is showing up in the browser.



        
5条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 04:55

    Just a comment in a form of an answer due to low reputation. if you get the documents via AJAX call, DO return the xhttp.responseXML and do NOT return xhttp.responseXML.documentElement.

    Both can be converted using XMLSerializer to a meaningful representation of the document but only the first statement is a viable parameter for the XSL Transformation.

    If the latter is used the return value of the XSLTransformation (using either toDocument or toFragment function) is null in my case (using Chrome)

    For that matter, I don't believe Chrome has dropped XSLT support as stated somewhere on the page here.

    Hope that helps

提交回复
热议问题