|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<xs:schema |
| 3 | + xmlns:xs="http://www.w3.org/2001/XMLSchema" |
| 4 | + xmlns:xml="http://www.w3.org/XML/1998/namespace" |
| 5 | + elementFormDefault="qualified" attributeFormDefault="unqualified"> |
| 6 | + <xs:import namespace="http://www.w3.org/XML/1998/namespace" |
| 7 | + schemaLocation="http://www.w3.org/2001/03/xml.xsd" /> |
| 8 | + <!-- TODO: Use namespaces for xs:import so schemas can be DRY --> |
| 9 | + |
| 10 | + <xs:element name="policy" type="Policy" /> |
| 11 | + <xs:complexType name="Policy"> |
| 12 | + <xs:sequence minOccurs="1" maxOccurs="1"> |
| 13 | + <xs:element name="profiles" type="Profiles" /> |
| 14 | + </xs:sequence> |
| 15 | + <xs:attribute name="version" type="xs:string" use="required" /> |
| 16 | + </xs:complexType> |
| 17 | + |
| 18 | + <xs:complexType name="Profiles"> |
| 19 | + <xs:sequence minOccurs="1" maxOccurs="unbounded"> |
| 20 | + <xs:element name="profile" type="Profile" /> |
| 21 | + </xs:sequence> |
| 22 | + </xs:complexType> |
| 23 | + |
| 24 | + <xs:complexType name="Profile"> |
| 25 | + <xs:sequence minOccurs="0" maxOccurs="unbounded"> |
| 26 | + <xs:choice minOccurs="1" maxOccurs="1"> |
| 27 | + <xs:element name="raws" minOccurs="1" type="RawExpressionList" /> |
| 28 | + </xs:choice> |
| 29 | + </xs:sequence> |
| 30 | + <xs:attribute name="ns" type="xs:string" use="required" /> |
| 31 | + <xs:attribute name="node" type="xs:string" use="required" /> |
| 32 | + <xs:attribute ref="xml:base" /> |
| 33 | + </xs:complexType> |
| 34 | + |
| 35 | + <xs:complexType name="RawExpressionList"> |
| 36 | + <xs:sequence minOccurs="1" maxOccurs="unbounded"> |
| 37 | + <xs:element name="raw" type="Expression" /> |
| 38 | + </xs:sequence> |
| 39 | + <xs:attribute name="publish" type="RuleQualifier" use="optional" /> |
| 40 | + <xs:attribute name="relay" type="RuleQualifier" use="optional" /> |
| 41 | + <xs:attribute name="subscribe" type="RuleQualifier" use="optional" /> |
| 42 | + <xs:attribute ref="xml:base" /> |
| 43 | + </xs:complexType> |
| 44 | + |
| 45 | + <xs:simpleType name="Expression"> |
| 46 | + <xs:restriction base="xs:string" /> |
| 47 | + </xs:simpleType> |
| 48 | + |
| 49 | + <xs:simpleType name="RuleQualifier"> |
| 50 | + <xs:restriction base="xs:string"> |
| 51 | + <xs:enumeration value="ALLOW" /> |
| 52 | + <xs:enumeration value="DENY" /> |
| 53 | + </xs:restriction> |
| 54 | + </xs:simpleType> |
| 55 | + |
| 56 | +</xs:schema> |
0 commit comments