-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtestmxml.html
More file actions
27 lines (27 loc) · 828 Bytes
/
testmxml.html
File metadata and controls
27 lines (27 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="testmxml.js"></script>
<script src="ValueTree.js"></script>
</head>
<body>
<input type="file" id="fileOpen" name="files[]"/>
<script>
console.log('start');
document.getElementById('fileOpen').addEventListener('change', fileOpen, false);
function fileOpen(event){
console.log('open',event.target.files[0]);
var fileReader = new FileReader();
fileReader.onload = function (progressEvent) {
//console.log('progressEvent',progressEvent);
//console.log('result',progressEvent.target.result);
var valueTree = new ValueTree();
valueTree.fromXMLstring(progressEvent.target.result);
dumpMXMLwhole(valueTree);
};
fileReader.readAsText(event.target.files[0]);
}
</script>
</body>
</html>