Widget: DataExporter: Difference between revisions
From LINKS Community Center
Eschmidt (talk | contribs) No edit summary |
Eschmidt (talk | contribs) No edit summary |
||
Line 23: | Line 23: | ||
const schema = await fetch(dat).then(rsp => rsp.text()); | const schema = await fetch(dat).then(rsp => rsp.text()); | ||
const doc = (new DOMParser).parseFromString(schema, 'text/xml'); | const doc = (new DOMParser).parseFromString(schema, 'text/xml'); | ||
for (const el of doc.querySelectorAll('Field')) { | |||
output.innerHTML += el.getAttribute('name'); | |||
output.innerHTML += ' | ' | |||
output.innerHTML += el.getElementsByTagName('Label').item(0)?.textContent; | |||
output.innerHTML += '<br>'; | |||
} | |||
output.innerText = schema; | // output.innerText = schema; | ||
} | } | ||
</script> | </script> |