Joachim Krech | e72625a | 2017-01-25 21:09:06 +0100 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!-- |
| 3 | |
| 4 | Copyright (c) 2013-2017 ARM Limited. All rights reserved. |
| 5 | |
| 6 | SPDX-License-Identifier: Apache-2.0 |
| 7 | |
| 8 | Licensed under the Apache License, Version 2.0 (the License); you may |
| 9 | not use this file except in compliance with the License. |
| 10 | You may obtain a copy of the License at |
| 11 | |
| 12 | http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | |
| 14 | Unless required by applicable law or agreed to in writing, software |
| 15 | distributed under the License is distributed on an AS IS BASIS, WITHOUT |
| 16 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | See the License for the specific language governing permissions and |
| 18 | limitations under the License. |
| 19 | |
| 20 | $Date: 23. Januar 2017 |
| 21 | $Revision: 1.1.0 |
| 22 | |
| 23 | $Project: Schema File for Package Index File Format Specification |
| 24 | |
| 25 | Package Index file naming convention <vendor>.pidx |
| 26 | Vendor Index file naming convention <vendor>.vidx |
| 27 | SchemaVersion=1.1.0 |
| 28 | --> |
| 29 | |
| 30 | <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="qualified" version="1.1.0"> |
| 31 | |
| 32 | <!-- semantic versioning (semver.org) <major>.<minor>.<patch>-<quality> --> |
| 33 | <xs:simpleType name="SemanticVersionType"> |
| 34 | <xs:restriction base="xs:string"> |
| 35 | <!-- <major> . <minor> . <patch> - <quality> + <build meta info> --> |
| 36 | <xs:pattern value="(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?"/> |
| 37 | </xs:restriction> |
| 38 | </xs:simpleType> |
| 39 | |
Joachim Krech | a26c16a | 2018-10-08 11:43:27 +0200 | [diff] [blame] | 40 | <!-- some strings are used to construct filenames (e.g. package name). Such names can contain only subset of characters and must not contain neither spaces nor dots. --> |
Joachim Krech | e72625a | 2017-01-25 21:09:06 +0100 | [diff] [blame] | 41 | <xs:simpleType name="RestrictedString"> |
| 42 | <xs:restriction base="xs:string"> |
Joachim Krech | a26c16a | 2018-10-08 11:43:27 +0200 | [diff] [blame] | 43 | <xs:pattern value="[\-_A-Za-z0-9]+"/> |
Joachim Krech | e72625a | 2017-01-25 21:09:06 +0100 | [diff] [blame] | 44 | <xs:pattern value="\S(.*\S)?"></xs:pattern> |
| 45 | </xs:restriction> |
| 46 | </xs:simpleType> |
| 47 | |
| 48 | <!-- Vendor index file Description Type --> |
| 49 | <xs:complexType name="VidxType"> |
| 50 | <xs:attribute name="url" type="xs:anyURI" use="required"/> |
| 51 | <xs:attribute name="vendor" type="RestrictedString" use="required"/> |
| 52 | <xs:attribute name="date" type="xs:date" use="optional"/> |
| 53 | </xs:complexType> |
| 54 | |
| 55 | <!-- Package Description Type --> |
| 56 | <xs:complexType name="PdscType"> |
| 57 | <xs:attribute name="url" type="xs:anyURI" use="required"/> |
| 58 | <xs:attribute name="vendor" type="RestrictedString" use="required"/> |
| 59 | <xs:attribute name="name" type="RestrictedString" use="required"/> |
| 60 | <xs:attribute name="version" type="SemanticVersionType" use="required"/> |
| 61 | <xs:attribute name="date" type="xs:date" use="optional"/> |
| 62 | <xs:attribute name="deprecated" type="xs:date" use="optional"/> |
| 63 | <xs:attribute name="replacement" type="RestrictedString" use="optional"/> |
| 64 | <xs:attribute name="size" type="xs:unsignedInt" use="optional"/> |
| 65 | </xs:complexType> |
| 66 | |
| 67 | <!-- Package Description file Type --> |
| 68 | <xs:complexType name="PindexType"> |
| 69 | <xs:sequence> |
| 70 | <xs:element name="pdsc" type="PdscType" maxOccurs="unbounded"/> |
| 71 | </xs:sequence> |
| 72 | </xs:complexType> |
| 73 | |
| 74 | <!-- Vendor vendor's package index file tag --> |
| 75 | <xs:complexType name="VindexType"> |
| 76 | <xs:sequence> |
| 77 | <xs:element name="pidx" type="VidxType" maxOccurs="unbounded"/> |
| 78 | </xs:sequence> |
| 79 | </xs:complexType> |
| 80 | |
| 81 | <!-- Index description root point (Vendor Index file, Package Index file --> |
| 82 | <xs:element name="index" nillable="true"> |
| 83 | <xs:complexType> |
| 84 | <xs:sequence> |
| 85 | <xs:element name="vendor" type="RestrictedString"/> |
| 86 | <xs:element name="url" type="xs:anyURI"/> |
| 87 | <xs:element name="timestamp" type="xs:dateTime" minOccurs="0"/> |
| 88 | <xs:choice minOccurs="1" maxOccurs="2"> |
| 89 | <!-- index/list of packs --> |
| 90 | <xs:element name="pindex" type="PindexType"/> |
| 91 | <!-- index/list of vendor index files --> |
| 92 | <xs:element name="vindex" type="VindexType"/> |
| 93 | </xs:choice> |
| 94 | </xs:sequence> |
| 95 | <xs:attribute name="schemaVersion" type="SemanticVersionType" use="required"/> |
| 96 | </xs:complexType> |
| 97 | </xs:element> |
| 98 | </xs:schema> |