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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!-- LLSD document has exactly one value -->
<xsd:element name="llsd">
<xsd:complexType>
<xsd:group ref="llsd-value" />
</xsd:complexType>
</xsd:element>
<!-- Value is one of undef, boolean, integer, real,
uuid, string, date, binary, array, or map -->
<xsd:group name="llsd-value">
<xsd:choice>
<xsd:element ref="undef"/>
<xsd:element ref="boolean"/>
<xsd:element ref="integer"/>
<xsd:element ref="real"/>
<xsd:element ref="uuid"/>
<xsd:element ref="string"/>
<xsd:element ref="date"/>
<xsd:element ref="uri"/>
<xsd:element ref="binary"/>
<xsd:element ref="array"/>
<xsd:element ref="map"/>
</xsd:choice>
</xsd:group>
<!-- Undefined is an empty eleemnt -->
<xsd:element name="undef">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="0" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<!-- Boolean is true or false -->
<xsd:element name="boolean">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
<!-- In practice, these other serializations are seen: -->
<xsd:enumeration value="" />
<xsd:enumeration value="1" />
<xsd:enumeration value="0" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<!-- Integer is restricted to 32-bit signed values -->
<xsd:element name="integer">
<xsd:simpleType>
<xsd:restriction base="xsd:int" />
</xsd:simpleType>
</xsd:element>
<!-- Real is an IEEE 754 "double" value, including Infinities and NaN -->
<xsd:element name="real">
<xsd:simpleType>
<!-- TODO: xsd:double uses "INF", "-INF", and "NaN",
whereas LLSD prefers "Infinity", "-Infinity" and "NaN" -->
<xsd:restriction base="xsd:double" />
</xsd:simpleType>
</xsd:element>
<!-- UUID per RFC 4122 -->
<xsd:element name="uuid">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<!-- String is any sequence of Unicode characters -->
<xsd:element name="string">
<xsd:simpleType>
<xsd:restriction base="xsd:string" />
</xsd:simpleType>
</xsd:element>
<!-- Date is ISO 8601 in UTC -->
<xsd:element name="date">
<xsd:simpleType>
<xsd:restriction base="xsd:dateTime">
<!-- Restrict to UTC (Z) times -->
<xsd:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?Z" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<!-- URI per RFC 3986 -->
<xsd:element name="uri">
<xsd:simpleType>
<xsd:restriction base="xsd:anyURI" />
</xsd:simpleType>
</xsd:element>
<!-- Binary data is base64 encoded -->
<xsd:element name="binary">
<xsd:simpleType>
<!-- TODO: Require encoding attribute? -->
<xsd:restriction base="xsd:base64Binary" />
</xsd:simpleType>
</xsd:element>
<!-- Array is a sequence of zero or more values -->
<xsd:element name="array">
<xsd:complexType>
<xsd:group minOccurs="0" maxOccurs="unbounded" ref="llsd-value" />
</xsd:complexType>
</xsd:element>
<!-- Map is a sequence of zero or more key/value pairs -->
<xsd:element name="map">
<xsd:complexType>
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element name="key">
<xsd:simpleType>
<xsd:restriction base="xsd:string" />
</xsd:simpleType>
</xsd:element>
<xsd:group ref="llsd-value" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
|