How to read XML file using FileReader javascript?

前端 未结 2 1477
不知归路
不知归路 2021-01-21 01:56

I need to get XML from a ODF file. I tried using FileReader readAsText and readAsBinaryString but its not working.

FileReader readAsText returns some s

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-21 02:08

    Using the response like text:

    var xml = data.replace(/[\s\S]+<\?xml/, '[\s\S]+/, 'office:document-meta>');
    

    :)

    If you need to load the xml like jquery object:

    xml = $(xml);
    

    then you can use jquery selector's on

提交回复
热议问题