I am attempting to import a XML into Google Apps Script for parsing, and I am getting the following:
Exception: The prefix "xsi" for attribute "xsi:schemaLocation" associated with an element type "Document" is not bound.
This is the code I ran:
function combinePaths() {
//1. Get xml:
var earthFile = DriveApp.getFileById("1Pa994sHM-B8gAFxmrQk0Q3CWeQm1-I61");
//2. Get xml string from xml:
/*We must change the type of the file to pull it in as an editable set of data.*/
var earthFileName = earthFile.getName();
var earthBlob = earthFile.getAs("text/xml");
var earthString = earthBlob.getDataAsString();
var earthContent = XmlService.parse(earthString);
The error is thrown on the last line. The error seems to have something to do with the construction of the particular XML I am attempting to import. however upon comparison of an XML that doesn't have this error thrown and one that does, there are no differences at least in the order of the overarching structure of the document, i.e.:
<Xml><Document><name><description> </Xml></Document></name></description>
etc...
Has anyone run into anything similar? Are there any resources one can point me to do determine the meaning of this error any more clearly?