1
***************************************************
2
*********** XSD (XML Schema Definition) ***********
3
***************************************************
4
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" XSD Namespace
5
targetNamespace="something" Says that the elements defined by
6
this schema are to go in this namespace
7
xlmns="something" Default namespace
8
elementFormDefault="qualified"> Any elements used by the instance
9
document which were declared in this
10
schema must be namespace qualified
11
... All other code ...
16
<xsd:include schemaLocation="file.xsd"/>
21
xsd:normalizedString String without tabs, CRs, line feeds
22
xsd:token Normalized String without leading/trailing/consecutive
24
xsd:boolean true|false
25
xsd:integer integer number
30
xsd:nonPositiveInteger integer in [-inf,0]
31
xsd:negativeInteger integer in [-inf,-1]
32
xsd:positiveInteger integer in [1,inf]
33
xsd:unsignedLong QWORD
35
xsd:unsignedShort WORD
38
xsd:float 12.56E3, INF, -INF, NAN
39
xsd:doble double precision
40
xsd:duration P1Y2M3DT10H30M12.3S (?)
41
xsd:dateTime CCYY-MM-DDThh-mm-ss
44
xsd:gYearMonth CCYY-MM
49
xsd:hexBinary hex number
50
xsd:base64Binary base64 string
52
xsd:QName a namespace qualified name
53
xsd:NOTATION a NOTATION from XML spec
54
xsd:language any valid xml:lang value (e.g. EN_US, ru_RU)
57
* Constructed Types, see xsd:simpleType
61
ID, IDREF, IDREFS, NMTOKEN, NMTOKENS, ENTITY, and ENTITIES
63
* Constructed Types, see xsd:complexType
67
<xsd:element name="catalog">
72
ref="name" Only reference on element, which will be described later
73
type="xsd:string" Type of element
74
minOccurs="1" Minimal occurences of the element
75
maxOccurs="1" Maximal number of occurences ("unbounded" - unlimited)
76
fixed="hell" ������� ���祭�� ������� (� ���� �� �� � �� 㪠���
77
� XML ���㬥�� �㤥� �������, �� � 㪠��� "hell")
79
* If element - complex, i.e. have sub element, next construction must be used:
82
... sub element description ...
86
* If element have greater then one sub element, then next construction must be
90
... sub elements description ...
94
* Reusing complex types
95
<xsd:complexType name="somename"> Something </xsd:complexType>
97
<xsd:element name="MyName" type="somename"/>
103
<xsd:element ref="author" minOccurs="1" maxOccurs="1"/>
105
<xsd:element name="author" ... > ... </xsd:element>
109
<xsd:simpleType name="typename">
110
<xsd:restriction base="xsd:string"> Specifing base type
111
<xsd:pattern value="some pattern"/>
112
<xsd:pattern value="other pattern"/>
116
* Elements declared of this type must conform to one of the specified patterns
117
* ���� ⨯� ����� 㪠�뢠�� ��� � �� ���㬥��, � ��⮬ �������� �
118
��� �� �����, ⠪ � � �����⭮� <xsd:element> ⮣�� �� �㤥� �������
123
<xsd:pattern value=""> - ���祭�� ������ ᮮ⢥��⢮���� ��� �� ������ ��
125
<xsd:length value="8"> - ������ ������ ��ப�, � ������ ��砥 ��ப� ������
126
������ �� �� ���쬨 ᨬ�����
127
<xsd:minLength ...> - �������쭠� ������ ��ப�
128
<xsd:maxLength ...> - ���ᨬ��쭠� ������ ��ப�
129
<xsd:enumeration value="a"> ������ �����⭮� ���祭��, �㦭� 㪠����
130
���쪮 ⠪�� ⥣��, �� �� ᮧ���� ᯨ᮪ ���������
132
<xsd:whitespace ...> - "preserve"
135
<xsd:totalDigits ...> �� ������ � �
136
<xsd:maxInclusive ...> ���ᨬ��쭮 �����⨬�� ���祭�� �
137
<xsd:maxExclusive ...> ����� ,a] -> ,a)
138
<xsd:minInclusive ...> �������쭮 �����⨬�� ���祭�� �
139
<xsd:minExclusive ...> ����� [a, -> (a,
141
* � 㪠���� ���쪮 ���������� ⥣��, � ���祭��
142
������ ᮮ⢥��⢮���� ��� �� ������ �� ���.
144
value="..." ���祭�� ��࠭�祭��
145
fixed="true" � 㪠����, � ���� ⨯� �������騥�� �� �⮬ ��
146
����� �������� ���祭�� �⮣� ��࠭�祭��.
149
Example: "\d{1}-\d{5}-\d{3}-\d{1}" "#-#####-###-#" (# in [0..9])
150
| or (for example '(\d{1}|\d{2})')
152
.,*,?,[],{} As in regexp rules
153
\p(L) A letter from any language
154
\p(Lu) A Capital letter from any language
155
\p(Ll) A lower case letter from any language
156
\p(N) Number, Roman number, fractions
157
\p(Nd) Digit from any language
158
\p(P) A Punctuatuion symbol
159
\p(Sc) Currency sign, from any language
164
<xsd:simpleType name="typename">
165
<xsd:list itemType="xsd:int"/>
170
* ���⢥����� ᯨ�� �� �ᥫ. ���ਬ��: 23 -13 34
171
length: - length of the list
172
minLength: - minimal length of the list
173
maxLength: - maximal length of the list
174
enumeration: - can be used to specify values that the list may have
175
pattern: - can be used to specify values that the list may have
179
<xsd:simpleType name="typename">
180
<xsd:union memberTypes="type1 type2 type3 ..."/>
183
* ������� ⨯ ��� ��ꥤ������ ⨯��
188
<xsd:complexType name="children">
190
<xsd:extension base="parrent">
192
... adding new elements ...
194
<xsd:restriction base="parrent">
196
... changing/adding restrictions of base class ...
197
( All elements of base class must been repeated )
200
<xsd:complexType name="..." final="#all" ...>
201
final="#all" - ����饭�� ��� ���������
202
final="restriction" - ����饭�� ��������� � ������� xsd:resriction
203
final="extension" - ����饭�� ��������� � ������� xsd:extension
208
<xsd:element name="hell"/>
209
<xsd:element name="inferno" substitutionGroup="hell"/>
211
��।��塞 �����������塞� ��������
212
* ������ ���� �������묨
213
* ������ ����� ��������� ⨯ (��� "inferno" ������ ����� ⨯�� �������
215
* �� �� ������� � substitution:
216
<xsd:element block="substitution" ... />
217
* Substitution are transitive, but non-symetric ( i.e. A->B->C then A->C,
218
but if B subsitute A, it is not the case that element A can substitute
224
<xsd:sequence> ... </xsd:sequence>
225
<xsd:attributeGroup ref="name"/> �� ��� inline
228
<xsd:attributeGroup name="name">
229
<xsd:attribute name="attr_name" use="required">
230
... may be xsd:simpleType ...
233
<xsd:any minOccurs="0"/> ���⢥����� �ந����쭮�� ���ਡ���
234
</xsd:attributeGroup>
236
* ���ਡ��� ������ ��।������� �� ��।������ ��� ���㧫��
237
* � ��砥 inline ����祭�� ���ਡ�⮢, xsd:attributeGroup ������ 㪠�뢠��,
238
���� �� ��।� ���������� xsd:attribute
240
��ࠬ���� xsd:attribute
241
use="required" ��易⥫�� ��ਡ�� (�� ࠡ�⠥� ��� ���������
244
optional - �� ��易⥫�� (default)
246
default="value" ���祭�� �� 㬠�砭��
247
fixed="value" �. element
248
type="type" ��� ���ਡ�� (��� �������� ����� � �������
251
namespace="..." '##targetNamespace' - allows new attribute
252
provided from then namespace that the schema
254
'##any' - allow any attribute (default)
255
'##local' - allow any unqualified attributes
257
---------------------
258
<xsd:group name="group_name">
260
... elements declarations
267
<xsd:sequence>...</xsd:sequence> ��樮���쭮
269
... elements declarations ...
273
XML ॠ������ ������ �㤥� ᮤ�ঠ�� ����(�� ����� � �� �����) �� 㪠������
281
<xsd:any minOccurs="0"/>
284
* xsd:any ᮮ⢥����� ��᮫�⭮ �ந����쭮�� ��������
288
���⠪�� ��� � xsd:choice, �蠥� �����, ����� ���㧫� ����� ��� �
295
<xsd:documentation> Anotation </xsd:documentation>
298
��ࠬ���� xsd:documentation:
299
source="URI" ���� ⥪�� ���
300
xml:lang="US" Codepage
302
* ����� ���� ⮫쪮 ����! ���㧫�� xsd:element
305
Including in xml document
306
-------------------------
307
<?xml version="1.0"?>
308
<RootItem xmlns="something" (Specifiying default namespace, must
309
corespond to value specified in .xsd
311
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
312
xsi:schemaLocation="targetNamespace (�������� � .xsd file)
315
* ����� ������ �� ᮮ⢥��⢨� ���쪨� �奬��:
316
xsi:schemaLocation="targetNamespace
323
* MinOccur & MaxOccur may be used only in nested element declaration
b'\\ No newline at end of file'