<?xml version="1.0" encoding="UTF-8"?>
<!--
	File:    tickers.xsd
	Author:  Chriztian Steinmeier
	Created: 2025-04-20
	Description:
		XMLSchema for the tickers XML format.

-->
<xsd:schema
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	targetNamespace="http://xmlns.greystate.sk/2025/tickers"
	xmlns="http://xmlns.greystate.sk/2025/tickers"
>

	<!-- Main description -->
	<xsd:annotation>
		<xsd:documentation xml:lang="en">
			<p xmlns="http://www.w3.org/1999/xhtml">
				An XML application for keeping track of recurring habits (e.g. reading, exercising etc.).
			</p>
			<p xmlns="http://www.w3.org/1999/xhtml">
				Typical prefix is <var>tk</var> e.g. <code>&lt;tk:tickers&gt;...&lt;/tk:tickers&gt;</code>
			</p>
		</xsd:documentation>
	</xsd:annotation>

	<!-- Root element -->
	<xsd:element name="tickers">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="ticker" minOccurs="0" maxOccurs="unbounded" />
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="ticker">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">
				<p xmlns="http://www.w3.org/1999/xhtml">
					Contains the ticks for this specific ticker
				</p>
			</xsd:documentation>
		</xsd:annotation>

		<xsd:complexType>
			<xsd:attribute name="name" type="xsd:string" use="required" />
			<xsd:attribute name="description" type="xsd:string" use="optional" />

			<xsd:sequence>
				<xsd:element ref="tick" minOccurs="0" maxOccurs="unbounded" />
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="tick">
		<xsd:complexType>
			<xsd:attribute name="date" type="xsd:date" use="required" />
		</xsd:complexType>
	</xsd:element>

</xsd:schema>
