schema/ssm.xsd
author František Kučera <franta-hg@frantovo.cz>
Sat, 05 Oct 2019 21:04:37 +0200
branchv_0
changeset 51 21dfb69028a0
parent 47 7e665331bc32
permissions -rw-r--r--
name: Sane software manifesto (lower case) + move common strings (title, url, author, license) from templates to the XML + fix changed files count + link to own license file

<?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="url" type="URL"/>
			<xs:element name="author" type="xs:string"/>
			<xs:element name="license" type="License"/>
			<xs:element name="preamble" type="xs:string"/>
			<xs:element name="chapter" type="Chapter" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="License">
		<xs:sequence>
			<xs:element name="name" type="xs:string"/>
			<xs:element name="abbreviation" type="xs:string"/>
			<xs:element name="url" type="URL"/>
			<xs:element name="year" type="xs:string">
				<xs:annotation>
					<xs:documentation>
						the copyright year
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="prefix" type="xs:string">
				<xs:annotation>
					<xs:documentation>
						used to compose a sentence: prefix+name+suffix
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="suffix" type="xs:string">
				<xs:annotation>
					<xs:documentation>
						used to compose a sentence: prefix+name+suffix
					</xs:documentation>
				</xs:annotation>
			</xs:element>
		</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="type" type="ItemType"/>
			<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="link" type="Link" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="item" type="Item" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	
	<xs:simpleType name="ItemType" final="restriction" >
		<xs:restriction base="xs:string">
			<xs:enumeration value="requirement">
				<xs:annotation>
					<xs:documentation>
						strict requirement that must be followed in order to call the software Sane
					</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="recommendation">
				<xs:annotation>
					<xs:documentation>
						recommendation that should be followed in order to call the software Sane, but might be neglected if there is a good reason to do so
					</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="information">
				<xs:annotation>
					<xs:documentation>
						additional information which supplements the requirements and recommendations or clarifies the purpose of the chapter
					</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:complexType name="Link">
		<xs:sequence>
			<xs:element name="url" type="URL"/>
			<xs:element name="type" type="LinkType"/>
			<xs:element name="title" type="xs:string"/>
			<xs:element name="description" type="xs:string" minOccurs="0"/>
			<xs:element name="quotation" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	
	<xs:simpleType name="LinkType" final="restriction" >
		<xs:restriction base="xs:string">
			<xs:enumeration value="related">
				<xs:annotation>
					<xs:documentation>
						generic link
					</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="compatible">
				<xs:annotation>
					<xs:documentation>
						link to a particular compatible rule in another guidelines
					</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="URL">
		<xs:restriction base="xs:string">
			<xs:pattern value="https?://[^ ]+"/>
		</xs:restriction>
	</xs:simpleType>

</xs:schema>