How to read XML file using FileReader javascript?

前端 未结 2 1475
不知归路
不知归路 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条回答
  •  [愿得一人]
    2021-01-21 02:04

    Here's a browser-based example, but this should be applicable to other JavaScript contexts:

    Make a Form:

    Gimme Yo ODF Cornbread

    Handle the Upload: (I'm using JQuery for brevity/simplicity)

    
    

    The xmldata variable contains your XML, ready for your magic.

提交回复
热议问题