Skip to content

Commit b92f842

Browse files
committed
docs: add xqdoc schema file
1 parent 8843c6c commit b92f842

File tree

1 file changed

+299
-0
lines changed

1 file changed

+299
-0
lines changed

src/main/xar-resources/xqdoc.xsd

Lines changed: 299 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,299 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
* Copyright (c)2010 Elsevier, Inc.
4+
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
* The use of the Apache License does not indicate that this project is
18+
* affiliated with the Apache Software Foundation.
19+
-->
20+
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
21+
targetNamespace="http://www.xqdoc.org/1.0"
22+
xmlns="http://www.xqdoc.org/1.0"
23+
elementFormDefault="qualified"
24+
attributeFormDefault="unqualified">
25+
26+
<!-- Simple type for defining the uris associated
27+
with things such as library modules associated
28+
with functions, variables, imports, etc. -->
29+
<xsd:simpleType name="uri">
30+
<xsd:restriction base="xsd:string"/>
31+
</xsd:simpleType>
32+
33+
<!-- Simple type for defining the type associated
34+
with things such as global variables, function
35+
parameters, and function return types etc. -->
36+
<xsd:complexType name="type">
37+
<xsd:simpleContent>
38+
<xsd:extension base="xsd:string">
39+
<xsd:attribute name="occurrence" type="occurrence" use="optional"/>
40+
</xsd:extension>
41+
</xsd:simpleContent>
42+
</xsd:complexType>
43+
44+
<!-- Complex type for function parameters -->
45+
<xsd:complexType name="parameters">
46+
<xsd:sequence>
47+
<xsd:element name="parameter" type="parameter" maxOccurs="unbounded"/>
48+
</xsd:sequence>
49+
</xsd:complexType>
50+
51+
<!-- Complex type for an individual function parameter -->
52+
<xsd:complexType name="parameter">
53+
<xsd:sequence>
54+
<xsd:element name="name" type="name" minOccurs="0"/>
55+
<xsd:element name="type" type="type" minOccurs="0"/>
56+
</xsd:sequence>
57+
</xsd:complexType>
58+
59+
<!-- Complex type for the return value from a function -->
60+
<xsd:complexType name="return">
61+
<xsd:sequence>
62+
<xsd:element name="type" type="type" minOccurs="0"/>
63+
</xsd:sequence>
64+
</xsd:complexType>
65+
66+
<!-- Simple type used for definging the number of occurrences for a global variable, function parameter
67+
or function return type -->
68+
<xsd:simpleType name="occurrence">
69+
<xsd:restriction base="xsd:string">
70+
<xsd:enumeration value="?"/>
71+
<xsd:enumeration value="*"/>
72+
<xsd:enumeration value="+"/>
73+
</xsd:restriction>
74+
</xsd:simpleType>
75+
76+
<!-- Simple type for defining the names associated
77+
with things such as functions, paramters, module name, etc. -->
78+
<xsd:simpleType name="name">
79+
<xsd:restriction base="xsd:string"/>
80+
</xsd:simpleType>
81+
82+
<!-- Complex type used for defining the functions
83+
invoked from within a particular function. -->
84+
<xsd:complexType name="invoked">
85+
<xsd:sequence>
86+
<xsd:element name="uri" type="uri"/>
87+
<xsd:element name="name" type="name"/>
88+
</xsd:sequence>
89+
<xsd:attribute name="arity" type="xsd:integer" use="optional"/>
90+
</xsd:complexType>
91+
92+
<!-- Complex type used for defining a custom comment type.
93+
The type attribute allows the differentiation of the custom
94+
comment types. If the custom comment is @example, then the
95+
value in the 'tag' attribute would be 'example'. -->
96+
<xsd:complexType name="custom">
97+
<xsd:complexContent>
98+
<xsd:extension base="mixed-text">
99+
<xsd:attribute name="tag" type="xsd:string" use="required"/>
100+
</xsd:extension>
101+
</xsd:complexContent>
102+
</xsd:complexType>
103+
104+
105+
<!-- Complex type used for defining the comments associated
106+
with a library module, imports, variables, or functions.
107+
The follow xqdoc 'directives' map to the equivalent
108+
elements defined below ... with the exception of description
109+
where there is no directive.
110+
111+
@author ...... author
112+
@version ..... version
113+
@param ....... param
114+
@return ...... return
115+
@error ....... error
116+
@deprecated .. deprecated
117+
@since ....... since
118+
@see ......... see -->
119+
<xsd:complexType name="comment">
120+
<xsd:sequence>
121+
<xsd:element name="description" type="mixed-text" minOccurs="0"/>
122+
<xsd:element name="author" type="mixed-text" minOccurs="0" maxOccurs="unbounded"/>
123+
<xsd:element name="version" type="mixed-text" minOccurs="0"/>
124+
<xsd:element name="param" type="mixed-text" minOccurs="0" maxOccurs="unbounded"/>
125+
<xsd:element name="return" type="mixed-text" minOccurs="0"/>
126+
<xsd:element name="error" type="mixed-text" minOccurs="0" maxOccurs="unbounded"/>
127+
<xsd:element name="deprecated" type="mixed-text" minOccurs="0"/>
128+
<xsd:element name="see" type="mixed-text" minOccurs="0" maxOccurs="unbounded"/>
129+
<xsd:element name="since" type="mixed-text" minOccurs="0" maxOccurs="unbounded"/>
130+
<xsd:element name="custom" type="custom" minOccurs="0" maxOccurs="unbounded"/>
131+
</xsd:sequence>
132+
</xsd:complexType>
133+
134+
<!-- Complex type used for comment text to allow the inclusion
135+
of embedded HTML markup within comments. -->
136+
<xsd:complexType name="mixed-text" mixed="true">
137+
<xsd:sequence>
138+
<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
139+
</xsd:sequence>
140+
</xsd:complexType>
141+
142+
<!-- Complex type used for defining information about the package
143+
version (and date) used to generate the internal xqdoc XML.
144+
Date should be the date when the XML xqdoc file is genearted.
145+
Version should either be the version of the XQDoc conversion package
146+
used to generate the XML or 'n/a' if the XML is generated from
147+
some other mechanism (i.e. scripts from XHTML for MarkLogic). -->
148+
<xsd:complexType name="control">
149+
<xsd:sequence>
150+
<xsd:element name="date" type="xsd:string"/>
151+
<xsd:element name="version">
152+
<xsd:simpleType>
153+
<xsd:restriction base="xsd:string">
154+
<xsd:enumeration value="1.0"/>
155+
<xsd:enumeration value="N/A"/>
156+
</xsd:restriction>
157+
</xsd:simpleType>
158+
</xsd:element>
159+
</xsd:sequence>
160+
</xsd:complexType>
161+
162+
<!-- Complex type used for defining the module URI and any
163+
high-level comments associated with the module. -->
164+
<xsd:complexType name="module">
165+
<xsd:sequence>
166+
<xsd:element name="uri" type="uri"/>
167+
<xsd:element name="name" type="name" minOccurs="0"/>
168+
<xsd:element name="comment" type="comment" minOccurs="0"/>
169+
<xsd:element name="body" type="xsd:string" minOccurs="0"/>
170+
</xsd:sequence>
171+
<xsd:attribute name="type" use="required">
172+
<xsd:simpleType>
173+
<xsd:restriction base="xsd:string">
174+
<xsd:enumeration value="main"/>
175+
<xsd:enumeration value="library"/>
176+
</xsd:restriction>
177+
</xsd:simpleType>
178+
</xsd:attribute>
179+
</xsd:complexType>
180+
181+
<!-- Complex type used for defining the namespaces defined within
182+
the library module. -->
183+
<xsd:complexType name="namespaces">
184+
<xsd:sequence>
185+
<xsd:element name="namespace" minOccurs="0" maxOccurs="unbounded">
186+
<xsd:complexType>
187+
<xsd:attribute name="prefix" use="required"/>
188+
<xsd:attribute name="uri" use="required"/>
189+
</xsd:complexType>
190+
</xsd:element>
191+
</xsd:sequence>
192+
</xsd:complexType>
193+
194+
<!-- Complex type used for defining the variable names defined within
195+
the library module and any comments associated with the variables. -->
196+
<xsd:complexType name="variables">
197+
<xsd:sequence>
198+
<xsd:element name="variable" minOccurs="0" maxOccurs="unbounded">
199+
<xsd:complexType>
200+
<xsd:sequence>
201+
<xsd:element name="uri" type="uri" minOccurs="0"/>
202+
<xsd:element name="name" type="name"/>
203+
<xsd:element name="comment" type="comment" minOccurs="0"/>
204+
<xsd:element name="annotations" type="annotations" minOccurs="0"/>
205+
<xsd:element name="type" type="type" minOccurs="0"/>
206+
</xsd:sequence>
207+
</xsd:complexType>
208+
</xsd:element>
209+
</xsd:sequence>
210+
</xsd:complexType>
211+
212+
<!-- Complex type used for defining the annotations defined for
213+
a variable or function. -->
214+
<xsd:complexType name="annotations">
215+
<xsd:sequence>
216+
<xsd:element name="annotation" minOccurs="0" maxOccurs="unbounded">
217+
<xsd:complexType>
218+
<xsd:sequence>
219+
<xsd:element name="literal" minOccurs="0" maxOccurs="unbounded">
220+
<xsd:complexType>
221+
<xsd:complexContent>
222+
<xsd:extension base="mixed-text">
223+
<xsd:attribute name="type" type="xsd:string" use="required"/>
224+
</xsd:extension>
225+
</xsd:complexContent>
226+
</xsd:complexType>
227+
</xsd:element>
228+
</xsd:sequence>
229+
<xsd:attribute name="name" use="required"/>
230+
</xsd:complexType>
231+
</xsd:element>
232+
</xsd:sequence>
233+
</xsd:complexType>
234+
235+
<!-- Complex type used for defining the imported modules within the
236+
the library module and any comments associated with the imports. -->
237+
<xsd:complexType name="imports">
238+
<xsd:sequence>
239+
<xsd:element name="import" minOccurs="0" maxOccurs="unbounded">
240+
<xsd:complexType>
241+
<xsd:sequence>
242+
<xsd:element name="uri" type="uri"/>
243+
<xsd:element name="comment" type="comment" minOccurs="0"/>
244+
</xsd:sequence>
245+
<xsd:attribute name="type" use="optional">
246+
<xsd:simpleType>
247+
<xsd:restriction base="xsd:string">
248+
<xsd:enumeration value="library"/>
249+
<xsd:enumeration value="schema"/>
250+
</xsd:restriction>
251+
</xsd:simpleType>
252+
</xsd:attribute>
253+
</xsd:complexType>
254+
</xsd:element>
255+
</xsd:sequence>
256+
</xsd:complexType>
257+
258+
<!-- Complex type used for defining the functions contained within the
259+
the library module and any comments associated with the functions.
260+
Any 'invoked' functions associated with this function should also
261+
be defined. -->
262+
<xsd:complexType name="functions">
263+
<xsd:sequence>
264+
<xsd:element name="function" minOccurs="0" maxOccurs="unbounded">
265+
<xsd:complexType>
266+
<xsd:sequence>
267+
<xsd:element name="comment" type="comment" minOccurs="0"/>
268+
<xsd:element name="name" type="name"/>
269+
<xsd:element name="annotations" type="annotations" minOccurs="0"/>
270+
<xsd:element name="signature" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
271+
<xsd:element name="parameters" type="parameters" minOccurs="0" maxOccurs="1"/>
272+
<xsd:element name="return" type="parameter" minOccurs="0" maxOccurs="1"/>
273+
<xsd:choice minOccurs="0" maxOccurs="unbounded">
274+
<xsd:element name="invoked" type="invoked" minOccurs="0" maxOccurs="unbounded"/>
275+
<xsd:element name="ref-variable" type="invoked" minOccurs="0" maxOccurs="unbounded"/>
276+
</xsd:choice>
277+
<xsd:element name="body" type="xsd:string" minOccurs="0"/>
278+
</xsd:sequence>
279+
<xsd:attribute name="arity" type="xsd:integer" use="optional"/>
280+
</xsd:complexType>
281+
</xsd:element>
282+
</xsd:sequence>
283+
</xsd:complexType>
284+
285+
<!-- Complex type used for defining the global root element of xqdoc.
286+
There should be '1' xqdoc xml file for each library module. -->
287+
<xsd:element name="xqdoc">
288+
<xsd:complexType>
289+
<xsd:sequence>
290+
<xsd:element name="control" type="control"/>
291+
<xsd:element name="module" type="module"/>
292+
<xsd:element name="imports" type="imports" minOccurs="0"/>
293+
<xsd:element name="namespaces" type="namespaces" minOccurs="0"/>
294+
<xsd:element name="variables" type="variables" minOccurs="0"/>
295+
<xsd:element name="functions" type="functions" minOccurs="0"/>
296+
</xsd:sequence>
297+
</xsd:complexType>
298+
</xsd:element>
299+
</xsd:schema>

0 commit comments

Comments
 (0)