data/dictionary.xsd
author František Kučera <franta-hg@frantovo.cz>
Sun, 06 Oct 2024 20:02:11 +0200
changeset 157 7abf9048d38d
parent 152 5c878a53d3ed
permissions -rw-r--r--
data: FXO and FXS modules on Digium/Asterisk analog telephony cards
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <!--
     3 Free Telco Dictionary
     4 Copyright © 2013 František Kučera (frantovo.cz)
     5 
     6 This program is free software: you can redistribute it and/or modify
     7 it under the terms of the GNU General Public License as published by
     8 the Free Software Foundation, version 3 of the License.
     9 
    10 This program is distributed in the hope that it will be useful,
    11 but WITHOUT ANY WARRANTY; without even the implied warranty of
    12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13 GNU General Public License for more details.
    14 
    15 You should have received a copy of the GNU General Public License
    16 along with this program.  If not, see <http://www.gnu.org/licenses/>.
    17 -->
    18 <xs:schema xmlns="https://telco.frantovo.cz/xmlns/dictionary"
    19            targetNamespace="https://telco.frantovo.cz/xmlns/dictionary"
    20            xmlns:xs="http://www.w3.org/2001/XMLSchema"
    21            elementFormDefault="qualified"
    22            attributeFormDefault="unqualified">
    23 
    24 	<xs:element name="dictionary" type="dictionaryType"/>
    25 
    26 	<xs:complexType name="dictionaryType">
    27 		<xs:sequence>
    28 			<xs:element name="id" type="ID"  minOccurs="0" maxOccurs="1"/>
    29 			<xs:element name="tags" type="tagsDefinitionType"  minOccurs="0" maxOccurs="1"/>
    30 			<xs:element name="concept" type="conceptType"  minOccurs="0" maxOccurs="unbounded">
    31 				<xs:annotation>
    32 					<xs:documentation>
    33 						Concept is an item of a dictionary – a term.
    34 						If an abbreviation or a word have two different meanings
    35 						it is two different concepts i.e. different meaning should not be mixed in a single concept.
    36 						Example: CLI (command-line interface) and CLI (call level interface) are two different concepts.
    37 					</xs:documentation>
    38 				</xs:annotation>
    39 			</xs:element>
    40 		</xs:sequence>
    41 	</xs:complexType>
    42 	
    43 	<xs:complexType name="tagsDefinitionType">
    44 		<xs:sequence>
    45 			<xs:element name="tag" type="tagDefinitionType" minOccurs="0" maxOccurs="unbounded"/>
    46 		</xs:sequence>
    47 	</xs:complexType>
    48 	
    49 	<xs:complexType name="tagDefinitionType">
    50 		<xs:attribute name="id" type="xs:string">
    51 			<xs:annotation>
    52 				<xs:documentation>
    53 					Tag IDs are not globally unique
    54 					(they are short and simple, so they can be easily added to concepts while editing the document by hand)
    55 					so when the disctionary is merged into another XML document, theese IDs should be prefixed e.g. with the dictionary ID.
    56 				</xs:documentation>
    57 			</xs:annotation>
    58 		</xs:attribute>
    59 		<xs:attribute name="name" type="xs:string"/>
    60 		<xs:attribute name="description" type="xs:string"/>
    61 	</xs:complexType>
    62 	
    63 	<xs:complexType name="conceptType">
    64 		<xs:sequence>
    65 			<xs:element name="id" type="ID"  minOccurs="0" maxOccurs="1">
    66 				<xs:annotation>
    67 					<xs:documentation>
    68 						This should be globally unique ID of the concept.
    69 						Concepts shared among multiple dictionaries should have same ID.
    70 					</xs:documentation>
    71 				</xs:annotation>
    72 			</xs:element>
    73 			<xs:element name="term" type="termType" minOccurs="1" maxOccurs="unbounded"/>
    74 			<xs:element name="explanation" type="explanationType"/>
    75 			<xs:element name="tag" type="tagRefType"  minOccurs="0" maxOccurs="unbounded"/>
    76 		</xs:sequence>
    77 	</xs:complexType>
    78 	
    79 	<xs:complexType name="termType">
    80 		<xs:sequence>
    81 			<xs:element name="tag" type="tagRefType"  minOccurs="0" maxOccurs="unbounded"/>
    82 		</xs:sequence>
    83 		<xs:attribute name="abbreviation" type="xs:string"/>
    84 		<xs:attribute name="completeForm" type="xs:string"/>
    85 		<xs:attribute name="language" type="languageType"/>
    86 	</xs:complexType>
    87 	
    88 	<xs:complexType name="explanationType">
    89 		<xs:all>
    90 			<xs:element name="text" type="textType"/>
    91 		</xs:all>
    92 		<xs:attribute name="language" type="languageType"/>
    93 	</xs:complexType>
    94 	
    95 	<xs:simpleType name="languageType">
    96 		<xs:restriction base="xs:string"/>
    97 	</xs:simpleType>
    98 	
    99 	<xs:simpleType name="textType">
   100 		<xs:restriction base="xs:string"/>
   101 	</xs:simpleType>
   102 	
   103 	<xs:simpleType name="tagRefType">
   104 		<xs:restriction base="xs:string"/>
   105 	</xs:simpleType>
   106 	
   107 	<xs:simpleType name="ID">
   108 		<xs:annotation>
   109 			<xs:documentation>
   110 				UUID, but must start with a letter, to comply with XML ID rules;
   111 				use e.g. uuidgen | grep ^[a-f];
   112 				Never reuse the ID if one chapter/item is removed and another with different meaning is added.
   113 			</xs:documentation>
   114 		</xs:annotation>
   115 		<xs:restriction base="xs:ID">
   116 			<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}"/>
   117 		</xs:restriction>
   118 	</xs:simpleType>
   119 
   120 </xs:schema>