Widget: DataExporter: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
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');
                 console.dir(doc)
                  
                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>

Revision as of 12:42, 15 August 2023