-
Notifications
You must be signed in to change notification settings - Fork 71
/
query.xsd
70 lines (70 loc) · 2.8 KB
/
query.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="query">
<xs:complexType>
<xs:choice>
<xs:element name="fields" type="fields" />
<xs:element name="field" type="field" />
</xs:choice>
<xs:attribute name="table" type="table" use="required" />
<xs:attribute name="select" type="select" use="optional"
default="*" />
<xs:attribute name="order" type="xs:string"
use="optional" />
<xs:attribute name="asc" type="xs:boolean" use="optional"
default="false" />
<xs:attribute name="page" type="xs:integer"
use="optional" default="1" />
<xs:attribute name="size" type="xs:integer"
use="optional" default="20" />
</xs:complexType>
</xs:element>
<xs:complexType name="fields">
<xs:sequence>
<xs:element name="fields" type="fields"
minOccurs="0" maxOccurs="unbounded" />
<xs:element name="field" type="field" minOccurs="1"
maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="logic" type="logic" use="required" />
</xs:complexType>
<xs:complexType name="field">
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="operator" type="operator" use="required" />
<xs:attribute name="value" type="xs:string" use="required" />
</xs:complexType>
<xs:simpleType name="table">
<xs:restriction base="xs:string">
<xs:enumeration value="Bug" />
<xs:enumeration value="Case" />
<xs:enumeration value="Result" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="select">
<xs:restriction base="xs:string">
<xs:enumeration value="*" />
<xs:enumeration value="count(*)" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="logic">
<xs:restriction base="xs:string">
<xs:enumeration value="OR" />
<xs:enumeration value="AND" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="operator">
<xs:restriction base="xs:string">
<xs:enumeration value="BETWEEN" />
<xs:enumeration value="GT" />
<xs:enumeration value="LT" />
<xs:enumeration value="GE" />
<xs:enumeration value="LE" />
<xs:enumeration value="EQ" />
<xs:enumeration value="NEQ" />
<xs:enumeration value="LIKE" />
<xs:enumeration value="NOTLIKE" />
<xs:enumeration value="IN" />
<xs:enumeration value="NOTIN" />
</xs:restriction>
</xs:simpleType>
</xs:schema>