Published
Edited
Aug 27, 2021
Fork of LocalFile
Insert cell
Insert cell
Insert cell
ab = FileAttachment("rimfax_calibrated_00047.xml")
Insert cell
t = ab.text()
Insert cell
xml1 = (new DOMParser).parseFromString(t,"application/xml")
Insert cell
xml1.children[0].children[0].children[0].nodeName
Insert cell
Insert cell
fa = new FA("https://andreasplesch.static.observableusercontent.com/files/c16a9978b1849f588936cc9aecd69045b59ea3db06ba7a73e4fdc9ae818a3149ff4b261294f529ada6d14cd976cb157bb17f94498956222843c4a3f14ed774a6?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27rimfax_calibrated_00047.xml&Expires=1629979200000&Key-Pair-Id=APKAJCHFJLLLU4Y2WVSQ&Signature=K6xzqe6VE7OC1h4LxNZIvqDaecI4Zhh3q4Pxe4mlLuq7lcYJ-Lm8bgGEgJB00A5iETug~LxP5BZBnWeKMGpFM5UmKe19m07WFU~3tIPmSbCI6nL3k4QYRcFEIiADjgCHxHAxmq2EVNrKKahRdIcCClrbxXn~qxJYG~Ulz4XTtt4soYw9bXpRLn5MY60Pr5LOr9q5eQjtEb-4M9~FFvYHAnZGdqlk0pyYSriTXfT8DIHAeiK8ewBO6aSYeGLheJfECrt2hc38U2gXlB6lPg265Ol1-D9cJ8qi6G96F7jgKb5JkGSkrH-~x8tIDsP2lcfF1N6vHfAcJn5cfkIX02ZEuw__") //,"rimfax_calibrated_00047.xml")//has CORS error
Insert cell
xml2 = fa.xml()
Insert cell
xml2.children[0].children[0].children[0].nodeName
Insert cell
Insert cell
newFA = FileAttachment("rimfax_calibrated_00047.xml");
Insert cell
xml3 = newFA.xml()
Insert cell
xml3.children[0].children[0].children[0].nodeName
Insert cell
Insert cell
Insert cell
class FA extends AbstractFile {
constructor(name) {
//debugger;
super(name);
//this.name = name;
}
// async url() {
// return (await this._url) + "";
// }
async xml() {
return (new DOMParser).parseFromString((await this.text()), "application/xml");
}
}
Insert cell
AbstractFile = FileAttachment("empty@1").constructor//.__proto__
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more