ssm.xsd
author František Kučera <franta-hg@frantovo.cz>
Fri, 20 Sep 2019 23:14:44 +0200
branchv_0
changeset 15 96fc2f42b1e1
permissions -rw-r--r--
conversion to XML format, XSD, XSLT + some forgotten changes

<?xml version="1.0" encoding="UTF-8"?>
<!--
	Sane Software Manifesto helper tools
	Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, version 3.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <https://www.gnu.org/licenses/>.
-->
<xs:schema xmlns="tag:globalcode.info,2019:sane-software/manifesto"
		   targetNamespace="tag:globalcode.info,2019:sane-software/manifesto"
		   xmlns:xs="http://www.w3.org/2001/XMLSchema"
		   elementFormDefault="qualified"
		   attributeFormDefault="unqualified">

	<xs:element name="manifesto" type="Manifesto"/>
	
	<xs:complexType name="Manifesto">
		<xs:sequence>
			<xs:element name="title" type="xs:string"/>
			<xs:element name="id" type="ID"/>
			<xs:element name="preamble" type="xs:string"/>
			<xs:element name="chapter" type="Chapter" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	
	<xs:simpleType name="ID">
		<xs:annotation>
			<xs:documentation>
				UUID, but must start with a letter, to comply with XML ID rules;
				use e.g. uuidgen | grep ^[a-f];
				Never reuse the ID if one chapter/item is removed and another with different meaning is added.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:ID">
			<xs:pattern value="[a-f][a-f0-9]{7}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"/>
		</xs:restriction>
	</xs:simpleType>
		
	<xs:complexType name="Chapter">
		<xs:sequence>
			<xs:element name="name" type="xs:string"/>
			<xs:element name="id" type="ID"/>
			<xs:element name="item" type="Item" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="Item">
		<xs:sequence>
			<xs:element name="id" type="ID"/>
			<xs:element name="text" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
			<xs:element name="note" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="item" type="Item" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

</xs:schema>