<?xml version="1.0" encoding="utf-8"?>
<!--
	File:    menusystem.xsd
	Author:  Chriztian Steinmeier
	Created: 2026-03-17
	Description:
		XMLSchema for the menusystem XML Application.
-->
<xsd:schema
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	targetNamespace="http://xmlns.greystate.dk/2026/menusystem"
	xmlns="http://xmlns.greystate.dk/2026/menusystem"
>

	<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />

	<!-- Main description -->
	<xsd:annotation>
		<xsd:documentation xml:lang="en">
			<p xmlns="http://www.w3.org/1999/xhtml">
				An XML application for marking up a menusystem for e.g. a website.
			</p>
			<p xmlns="http://www.w3.org/1999/xhtml">
				Typical prefix is <var>m</var> e.g. <code>&lt;m:menusystem&gt;...&lt;/m:menusystem&gt;</code>
			</p>
		</xsd:documentation>
	</xsd:annotation>

	<xsd:element name="menusystem">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="menu" minOccurs="0" maxOccurs="unbounded" />
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="menu">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="header" minOccurs="0" maxOccurs="1" />
				<xsd:group ref="itemTypes" minOccurs="0" maxOccurs="unbounded" />
			</xsd:sequence>
			<xsd:attribute name="id" type="xsd:ID" />
			<xsd:attribute name="closebutton" type="yesNoType" />
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="header" type="xsd:string" />

	<xsd:element name="item">
		<xsd:complexType>
			<xsd:simpleContent>
				<xsd:extension base="xsd:string">
					<xsd:attribute name="href" type="xsd:anyURI" use="optional" />
					<xsd:attribute name="menu" type="xsd:IDREF" use="optional" />
					<xsd:attribute name="disabled" type="yesNoType" use="optional" />
				</xsd:extension>
			</xsd:simpleContent>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="separator" />

	<xsd:group name="itemTypes">
		<xsd:choice>
			<xsd:element ref="item" minOccurs="0" maxOccurs="1" />
			<xsd:element ref="separator" minOccurs="0" maxOccurs="1" />
		</xsd:choice>
	</xsd:group>

	<xsd:simpleType name="yesNoType">
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="yes" />
			<xsd:enumeration value="no" />
		</xsd:restriction>
	</xsd:simpleType>

</xsd:schema>
