diff --git a/index.html b/index.html index 4e1c179..9d9827e 100644 --- a/index.html +++ b/index.html @@ -47,16 +47,26 @@ const parser = new DOMParser(); const doc = parser.parseFromString(text, 'application/xml'); + // Check for XML parsing errors + const parseError = doc.querySelector('parsererror'); + if(parseError){ + throw new Error('XML parsing error: ' + parseError.textContent); + } + // Check if we have groups or just services const groups = Array.from(doc.getElementsByTagName('group')); const hasGroups = groups.length > 0; + console.log('Found', groups.length, 'groups'); + if(hasGroups){ // Render grouped services groups.forEach(group => { const groupName = group.getAttribute('name') || 'Services'; const services = Array.from(group.getElementsByTagName('service')); + console.log('Group:', groupName, 'has', services.length, 'services'); + if(services.length === 0) return; // Create group section @@ -310,7 +320,7 @@ }catch(err){ console.error(err); - grid.innerHTML = '

Error loading services.xml — see console for details.

'; + container.innerHTML = '

Error loading services.xml — see console for details.

'; } })(); diff --git a/services.xml b/services.xml index 716cded..6a0fc71 100644 --- a/services.xml +++ b/services.xml @@ -39,7 +39,16 @@ - + + + + + + + + + +