1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <xs : schema xmlns : xs =" http://www.w3.org/2001/XMLSchema"
3
+ targetNamespace =" pystatemachine:sm"
4
+ xmlns : sm =" pystatemachine:sm" >
5
+ <!-- definition of simple elements -->
6
+ <xs : element name =" Condition" type =" sm:NonEmptyString" />
7
+ <xs : element name =" Action" type =" sm:NonEmptyString" />
8
+ <!-- definition of simple type -->
9
+ <xs : simpleType name =" NonEmptyString" > <!-- we can describe our types separately to reuse them later -->
10
+ <xs : restriction base =" xs:string" >
11
+ <xs : minLength value =" 1" />
12
+ <xs : pattern value =" .*[^\s].*" />
13
+ </xs : restriction >
14
+ </xs : simpleType >
15
+
16
+ <!-- definition of Complex Type-->
17
+ <xs : complexType name =" Conditions" >
18
+ <xs : sequence >
19
+ <xs : element ref =" sm:Condition" minOccurs =" 1" />
20
+ </xs : sequence >
21
+ </xs : complexType >
22
+
23
+ <xs : complexType name =" Actions" >
24
+ <xs : sequence >
25
+ <xs : element ref =" sm:Action" minOccurs =" 1" />
26
+ </xs : sequence >
27
+ </xs : complexType >
28
+
29
+ <!-- definition of attributes -->
30
+
31
+ <!-- definition of complex elements -->
32
+
33
+
34
+ <xs : complexType name =" Event" >
35
+ <xs : sequence >
36
+ <xs : element name =" Name" type =" sm:NonEmptyString" minOccurs =" 1" maxOccurs =" 1" />
37
+ <xs : element name =" ToState" type =" sm:NonEmptyString" minOccurs =" 1" maxOccurs =" 1" />
38
+ <xs : element name =" PreConditions" type =" sm:Conditions" minOccurs =" 0" />
39
+ <xs : element name =" PostConditions" type =" sm:Conditions" minOccurs =" 0" />
40
+ <xs : element name =" PreActions" type =" sm:Actions" minOccurs =" 0" />
41
+ <xs : element name =" PostActions" type =" sm:Actions" minOccurs =" 0" />
42
+ </xs : sequence >
43
+ </xs : complexType >
44
+
45
+ <!-- xs:element name="State"-->
46
+ <xs : complexType name =" StateType" >
47
+ <xs : sequence >
48
+ <xs : element name =" Name" type =" sm:NonEmptyString" minOccurs =" 1" maxOccurs =" 1" />
49
+ <xs : element name =" Event" type =" sm:Event" minOccurs =" 1" />
50
+ </xs : sequence >
51
+ </xs : complexType >
52
+ <!-- /xs:element-->
53
+
54
+ <xs : complexType name =" StateList" >
55
+ <xs : sequence >
56
+ <xs : element name =" State" type =" sm:StateType" minOccurs =" 2" maxOccurs =" unbounded" />
57
+ <xs : element name =" Initial_State" type =" sm:NonEmptyString" minOccurs =" 1" maxOccurs =" 1" />
58
+ </xs : sequence >
59
+ </xs : complexType >
60
+
61
+ <xs : element name =" States" type =" sm:StateList" />
62
+
63
+ </xs : schema >
0 commit comments