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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!--
* LanguageTool, a natural language style checker
* Copyright (c) Marcin Miłkowski, 2009 (http://www.languagetool.org)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
* USA
Schema for rule files
-->
<xs:include schemaLocation="pattern.xsd"/>
<xs:annotation>
<xs:documentation xml:lang="en"> Main element
</xs:documentation>
</xs:annotation>
<xs:element name="rules">
<xs:complexType>
<xs:choice minOccurs="1" maxOccurs="unbounded" >
<xs:element ref="unification" />
<xs:element ref="phrases"/>
<xs:element ref="category"/>
</xs:choice>
<xs:attribute name="lang" type="xs:language" use="required" />
</xs:complexType>
</xs:element>
<xs:annotation>
<xs:documentation xml:lang="en"> Use the category element
to group rules/rulegroups. </xs:documentation>
<xs:documentation xml:lang="en"> The attribute name shows
the category use, e.g. 'Grammar', 'Spelling', 'Style' etc.
</xs:documentation>
</xs:annotation>
<xs:element name="category">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element ref="rule" />
<xs:element ref="rulegroup" />
</xs:choice>
<xs:attribute name="default" use="optional">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="off" />
<xs:enumeration value="on" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="name" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
<xs:annotation>
<xs:documentation xml:lang="en"> Defines a group of rules
to display several
rules as one in the configuration user interface. A group has a unique ID.
The whole rule group can be switched by default off using the
attribute 'default'.
</xs:documentation>
</xs:annotation>
<xs:element name="rulegroup">
<xs:complexType>
<xs:sequence minOccurs="1">
<xs:element ref="rule" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="default" use="optional">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="off" />
<xs:enumeration value="on" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="name" type="xs:string" use="optional" />
<xs:attribute name="id" type="xs:ID" use="required" />
</xs:complexType>
</xs:element>
<xs:annotation>
<xs:documentation xml:lang="en"> The rule element. The
unique ID is
required only if the rule is not contained in a rule group.
The rule can be switched by default off (using the default attribute).
</xs:documentation>
</xs:annotation>
<xs:element name="rule">
<xs:complexType>
<xs:sequence>
<xs:element ref="pattern" />
<xs:element ref="message" />
<xs:element ref="short" minOccurs="0" />
<xs:element ref="example" minOccurs="2" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="default" use="optional">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="off" />
<xs:enumeration value="on" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="name" type="xs:string" use="optional" />
<xs:attribute name="id" type="xs:ID" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="pattern">
<xs:complexType>
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element ref="token" />
<xs:element ref="phraseref" />
<xs:element ref="and" />
<xs:element ref="unify" />
</xs:choice>
<xs:attribute name="mark_from" type="xs:nonNegativeInteger"
use="optional" />
<xs:attribute name="mark_to" type="xs:nonPositiveInteger"
use="optional" />
<xs:attribute name="case_sensitive" type="binaryYesNo"
use="optional" />
</xs:complexType>
</xs:element>
<xs:annotation>
<xs:documentation xml:lang="en"> A short description of
the error detected by this rule displayed on the
context menu in OOo.
</xs:documentation>
</xs:annotation>
<xs:element name="short" type="xs:token" />
<xs:annotation>
<xs:documentation xml:lang="en"> Message shown to the user
if a rule matches. </xs:documentation>
</xs:annotation>
<xs:element name="message" xml:space="preserve">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="suggestion" />
<xs:element ref="match" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:annotation>
<xs:documentation xml:lang="en"> Suggestion displayed to
the user. </xs:documentation>
</xs:annotation>
<xs:element name="suggestion">
<xs:complexType mixed="true">
<xs:sequence minOccurs='0' maxOccurs='unbounded'>
<xs:element ref="match" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:annotation>
<xs:documentation xml:lang="en"> Specifies examples used
in JUnit tests and as internal documentation.
The attribute 'correction' is used to check if the suggested correction
is correct; multiple
suggestions are joined with "|".
The attribute triggers_error is not used.
</xs:documentation>
</xs:annotation>
<xs:element name="example" xml:space="preserve">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="marker" />
</xs:choice>
<xs:attribute name="correction" type="xs:string"
use="optional" />
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="correct" />
<xs:enumeration value="incorrect" />
<xs:enumeration value="triggers_error" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="reason" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
</xs:schema>
|