Difference between revisions of "Widget:DataExporter"
From LINKS Community Center
Line 24: | Line 24: | ||
const doc = (new DOMParser).parseFromString(schema, 'text/xml'); | const doc = (new DOMParser).parseFromString(schema, 'text/xml'); | ||
− | for (const | + | for (const field of doc.querySelectorAll('Field')) { |
− | const prop = | + | const prop = field.querySelector('semanticmediawiki_Property')?.getAttribute('name') || field.getAttribute('name'); |
− | + | const label = field.querySelector('Label')?.textContent; | |
− | const label = | ||
output.innerHTML += prop + ' | ' + label + '<br>'; | output.innerHTML += prop + ' | ' + label + '<br>'; | ||
} | } |