summaryrefslogtreecommitdiffstats
path: root/JLanguageTool/src/rules/rules.xsd
diff options
context:
space:
mode:
Diffstat (limited to 'JLanguageTool/src/rules/rules.xsd')
-rw-r--r--JLanguageTool/src/rules/rules.xsd208
1 files changed, 208 insertions, 0 deletions
diff --git a/JLanguageTool/src/rules/rules.xsd b/JLanguageTool/src/rules/rules.xsd
new file mode 100644
index 0000000..3df27f3
--- /dev/null
+++ b/JLanguageTool/src/rules/rules.xsd
@@ -0,0 +1,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>