Widget: DataExporter: Difference between revisions
From LINKS Community Center
Eschmidt (talk | contribs) No edit summary |
Eschmidt (talk | contribs) No edit summary |
||
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>'; | ||
} | } |