xml/schema/lib/types/std.xsd

137 lines
5.4 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:simpleType name="t_std_UUID4">
<xs:restriction base="xs:token">
<xs:pattern value="\s*[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}\s*"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="t_std_cksum">
<xs:simpleContent>
<xs:extension base="t_std_nonempty">
<xs:attribute name="hashType" use="required" type="t_std_cksum_hashtypes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="t_std_cksum_file">
<xs:simpleContent>
<xs:extension base="t_std_uri">
<xs:attribute name="hashType" use="required" type="t_std_cksum_hashtypes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="t_std_cksum_hashtypes">
<xs:restriction base="xs:string">
<xs:enumeration value="adler32"/>
<xs:enumeration value="crc32"/>
<xs:enumeration value="md5"/>
<xs:enumeration value="sha1"/>
<xs:enumeration value="sha224"/>
<xs:enumeration value="sha256"/>
<xs:enumeration value="sha384"/>
<xs:enumeration value="sha512"/>
<xs:enumeration value="blake2b"/>
<xs:enumeration value="blake22"/>
<xs:enumeration value="sha3_224"/>
<xs:enumeration value="sha3_256"/>
<xs:enumeration value="sha3_384"/>
<xs:enumeration value="sha3_512"/>
<xs:enumeration value="shake_128"/>
<xs:enumeration value="shake_256"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="t_std_cmdopts">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" use="required" type="xs:token"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="t_std_epoch_or_iso">
<!-- positiveInteger is used for UNIX Epoch. -->
<xs:union memberTypes="xs:dateTime xs:positiveInteger"/>
</xs:simpleType>
<xs:complexType name="t_std_gpg_keys">
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="keyID" minOccurs="1" maxOccurs="unbounded" type="t_std_gpg_key_id"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="t_std_gpg_key_id">
<xs:restriction base="xs:string">
<xs:pattern value="(auto|default)"/><!-- Program should accept any key IDs it finds (INSECURE) -->
<xs:pattern value="\s*(0x)?[0-9A-Fa-f]{40}\s*"/><!-- Full key ID -->
<xs:pattern value="\s*(0x)?[0-9A-Fa-f]{16}\s*"/><!-- Shorthand key ID -->
<xs:pattern value="\s*(0x)?[0-9A-Fa-f]{8}\s*"/><!-- Legacy shorter shorthand -->
<xs:pattern value="\s*([0-9A-Fa-f ]{4}){5} ?([0-9A-Fa-f ]{4}){4}[0-9A-Fa-f]{4}\s*"/><!-- Fingerprint -->
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="t_std_gpg_sig">
<xs:restriction base="xs:string">
<xs:whiteSpace value="preserve"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="t_std_nonempty">
<xs:restriction base="xs:token">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="t_std_uri">
<xs:restriction base="xs:anyURI">
<xs:pattern value="\s*(https?|ftps?|file)://.+\s*"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="t_std_verifyfile">
<xs:choice minOccurs="1" maxOccurs="2">
<xs:element name="gpg" minOccurs="0" maxOccurs="1" type="t_std_verify_gpg">
<xs:unique name="uniq_gpg_sig">
<xs:selector xpath="signature"/>
<xs:field xpath="."/>
</xs:unique>
<xs:unique name="uniq_gpg_sigfile">
<xs:selector xpath="signatureFile"/>
<xs:field xpath="."/>
</xs:unique>
</xs:element>
<xs:element name="hash" minOccurs="0" maxOccurs="1" type="t_std_verify_cksum"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="t_std_verify_cksum">
<xs:sequence>
<xs:element name="checksum" minOccurs="0" maxOccurs="unbounded" type="t_std_cksum"/>
<xs:element name="checksumFile" minOccurs="0" maxOccurs="unbounded" type="t_std_cksum_file"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="t_std_verify_gpg">
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="signature" minOccurs="0" maxOccurs="unbounded" type="t_std_gpg_sig"/>
<xs:element name="signatureFile" minOccurs="0" maxOccurs="unbounded" type="t_std_uri"/>
<xs:element name="gpgKeyIDs" minOccurs="1" maxOccurs="1" type="t_std_gpg_keys">
<xs:unique name="uniq_key_id">
<xs:selector xpath="keyID"/>
<xs:field xpath="."/>
</xs:unique>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:schema>