Difference between revisions of "Widget:DataExporter"

From LINKS Community Center
Jump to: navigation, search
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 13:42, 15 August 2023