ssm.xsd
author František Kučera <franta-hg@frantovo.cz>
Sat, 21 Sep 2019 01:12:49 +0200
branchv_0
changeset 20 fb939d9baaf4
parent 15 96fc2f42b1e1
permissions -rw-r--r--
make: statistics (just for fun) generates output: chapter: ╭──────────────────────────────────┬──────────────────────╮ │ name (string) │ item_count (integer) │ ├──────────────────────────────────┼──────────────────────┤ │ Free software │ 7 │ │ Documented │ 5 │ │ Semantic versioning │ 5 │ │ Compatible with itself │ 6 │ │ Compatible with others │ 6 │ │ Modular architecture │ 4 │ │ Extensible │ 7 │ │ Testable │ 4 │ │ Safe code and sustainability │ 6 │ │ Small code footprint │ 3 │ │ Sane dependencies │ 10 │ │ Easily auditable │ 3 │ │ Reproducible builds │ 2 │ │ Trustworthy packages and sources │ 6 │ │ Network interactions │ 4 │ │ Localized/internationalized │ 11 │ │ Communication channels │ 23 │ │ Accept contributions │ 13 │ │ Open development – has public: │ 4 │ ╰──────────────────────────────────┴──────────────────────╯ Record count: 19

<?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>