Skip to content

Commit 65b5b72

Browse files
committed
Add documentation to output.xml schema.
Part of robotframework#3726.
1 parent 24fcdef commit 65b5b72

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

doc/schema/robot.02.xsd

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,38 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- This has been written in XSD 1.0 -->
32
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
3+
<xs:annotation>
4+
<xs:documentation xml:lang="en">
5+
= Robot Framework output.xml schema =
6+
7+
Compatible with Robot Framework 4.0 and newer. For more details see:
8+
https://github.com/robotframework/robotframework/tree/master/doc/schema
9+
10+
Due to XSD 1.1 not being widely adopted, this schema is XSD 1.0 compatible.
11+
If you can use XSD 1.1, you can replace `xs:choice` groups with `xs:all`
12+
groups to make the schema more strict.
13+
</xs:documentation>
14+
</xs:annotation>
415
<xs:element name="robot" type="Robot" />
516
<xs:complexType name="Robot">
617
<xs:sequence>
18+
<!-- Executed suite structure. -->
719
<xs:element name="suite" type="Suite" />
20+
<!-- Execution statistics. Not read by Robot Framework itself. -->
821
<xs:element name="statistics" type="Statistics" minOccurs="0" />
22+
<!-- Possible execution errors and warnings. -->
923
<xs:element name="errors" type="Errors" minOccurs="0" />
1024
</xs:sequence>
1125
<xs:attribute name="generator" type="xs:string" />
1226
<xs:attribute name="generated" type="xs:string" />
27+
<!-- True when executing tasks, false (default) when executing tests. -->
1328
<xs:attribute name="rpa" type="xs:boolean" />
29+
<!-- Version of the schema output.xml is compatible with. -->
1430
<xs:attribute name="schemaversion" type="xs:int" />
1531
</xs:complexType>
1632
<xs:complexType name="Suite">
1733
<xs:choice maxOccurs="unbounded">
34+
<!-- These keywords are possible suite setup and teardown.
35+
They must have the `type` attribute set accordingly. -->
1836
<xs:element name="kw" type="Keyword" minOccurs="0" maxOccurs="2" />
1937
<xs:element name="suite" type="Suite" minOccurs="0" maxOccurs="unbounded" />
2038
<xs:element name="test" type="Test" minOccurs="0" maxOccurs="unbounded" />
@@ -52,7 +70,9 @@
5270
<xs:element name="kw" type="Keyword" minOccurs="0" maxOccurs="unbounded" />
5371
<xs:element name="for" type="For" minOccurs="0" maxOccurs="unbounded" />
5472
<xs:element name="if" type="If" minOccurs="0" maxOccurs="unbounded" />
73+
<!-- Assigned variables. -->
5574
<xs:element name="var" type="xs:string" minOccurs="0" />
75+
<!-- Arguments -->
5676
<xs:element name="arg" type="xs:string" minOccurs="0" />
5777
<xs:element name="doc" type="xs:string" minOccurs="0" />
5878
<xs:element name="msg" type="Message" minOccurs="0" maxOccurs="unbounded" />
@@ -62,7 +82,9 @@
6282
</xs:choice>
6383
<xs:attribute name="name" type="xs:string" />
6484
<xs:attribute name="library" type="xs:string" />
85+
<!-- Original name of the keyword when using embedded arguments, not used otherwise. -->
6586
<xs:attribute name="sourcename" type="xs:string" />
87+
<!-- Type is used only with setup and teardown. -->
6688
<xs:attribute name="type" type="KeywordType" />
6789
</xs:complexType>
6890
<xs:simpleType name="KeywordType">
@@ -73,8 +95,11 @@
7395
</xs:simpleType>
7496
<xs:complexType name="For">
7597
<xs:choice maxOccurs="unbounded">
98+
<!-- Loop variables. -->
7699
<xs:element name="var" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
100+
<!-- Loop values. -->
77101
<xs:element name="value" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
102+
<!-- Individual loop iterations. -->
78103
<xs:element name="iter" type="ForIteration" minOccurs="0" maxOccurs="unbounded" />
79104
<xs:element name="msg" type="Message" minOccurs="0" maxOccurs="unbounded" />
80105
<xs:element name="doc" type="xs:string" minOccurs="0" />
@@ -92,6 +117,7 @@
92117
</xs:simpleType>
93118
<xs:complexType name="ForIteration">
94119
<xs:choice maxOccurs="unbounded">
120+
<!-- Loop variables with iteration specific values. -->
95121
<xs:element name="var" type="ForIterationVariable" minOccurs="0" maxOccurs="unbounded" />
96122
<xs:element name="kw" type="Keyword" minOccurs="0" maxOccurs="unbounded" />
97123
<xs:element name="for" type="For" minOccurs="0" maxOccurs="unbounded" />
@@ -110,6 +136,7 @@
110136
</xs:complexType>
111137
<xs:complexType name="If">
112138
<xs:choice maxOccurs="unbounded">
139+
<!-- IF/ELSE branches. -->
113140
<xs:element name="branch" type="IfBranch" minOccurs="0" maxOccurs="unbounded" />
114141
<xs:element name="msg" type="Message" minOccurs="0" maxOccurs="unbounded" />
115142
<xs:element name="doc" type="xs:string" minOccurs="0" />
@@ -161,6 +188,7 @@
161188
<xs:attribute name="status" type="StatusValue" use="required" />
162189
<xs:attribute name="starttime" type="xs:string" />
163190
<xs:attribute name="endtime" type="xs:string" />
191+
<!-- Not set if both `starttime` and `endtime` are defined. -->
164192
<xs:attribute name="elapsedtime" type="xs:string" />
165193
</xs:extension>
166194
</xs:simpleContent>
@@ -170,7 +198,8 @@
170198
<xs:enumeration value="PASS" />
171199
<xs:enumeration value="FAIL" />
172200
<xs:enumeration value="SKIP" />
173-
<xs:enumeration value="NOT RUN" /> <!-- Not used with suite or test -->
201+
<!-- Only used with keywords, FORs and IFs, not with tests and suites. -->
202+
<xs:enumeration value="NOT RUN" />
174203
</xs:restriction>
175204
</xs:simpleType>
176205
<xs:complexType name="Timeout">

0 commit comments

Comments
 (0)