Estoy tratando de leer archivos XML en mi aplicación cliente.
const handleFiles = files => { console.log(files[0]) } <ReactFileReader multipleFiles={false} fileTypes={[".xml"]} handleFiles={handleFiles}> <button className='btn'>Upload</button> </ReactFileReader>Esta es la salida:
File {name: 'test.xml', lastModified: 1644272268000, lastModifiedDate: Tue Feb 08 2022 00:17:48 GMT+0200 (Eastern European Standard Time), webkitRelativePath: '', size: 58152550, …} lastModified: 1644272268000 lastModifiedDate: Tue Feb 08 2022 00:17:48 GMT+0200 (Eastern European Standard Time) [[Prototype]]: Object name: "F17_LeaderSFR_HebergeBYT_AuditOMC_20220208_0005.xml" size: 58152550 type: "text/xml" webkitRelativePath: "" [[Prototype]]: FileCuando intento analizar el archivo XML en una cadena
var xml = new XMLParser().parseFromString(files[0], "text/xml");Obtuve el siguiente error
Uncaught TypeError: (intermediate value)(intermediate value).replace is not a function