[MERGE]from trunk
[odoo/odoo.git] / bin / import_xml.rng
1 <?xml version="1.0" encoding="UTF-8"?>
2 <rng:grammar xmlns:rng="http://relaxng.org/ns/structure/1.0">
3     <rng:define name="any">
4       <rng:element>
5         <rng:anyName/>
6         <rng:zeroOrMore>
7             <rng:choice>
8             <rng:attribute>
9             <rng:anyName/>
10             </rng:attribute>
11             <rng:text/>
12             <rng:ref name="any"/>
13             </rng:choice>
14         </rng:zeroOrMore>
15         </rng:element>
16     </rng:define>
17
18     <rng:define name="value">
19         <rng:element name="value">
20             <rng:optional><rng:attribute name="model" /></rng:optional>
21             <rng:optional><rng:attribute name="search" /></rng:optional>
22             <rng:optional>
23                 <rng:attribute name="eval"/>
24             </rng:optional>
25             <rng:empty />
26         </rng:element>
27     </rng:define>
28
29     <rng:define name="function">
30         <rng:element name="function">
31             <rng:attribute name="model" />
32             <rng:attribute name="name" />
33             <rng:optional><rng:attribute name="id" /></rng:optional>
34             <rng:optional><rng:attribute name="eval" /></rng:optional>
35             <rng:optional><rng:attribute name="context" /></rng:optional>
36             <rng:choice>
37                 <rng:empty />
38                 <rng:oneOrMore>
39                     <rng:choice>
40                         <rng:ref name="value" />
41                         <rng:ref name="function" />
42                     </rng:choice>
43                 </rng:oneOrMore>
44             </rng:choice>
45         </rng:element>
46     </rng:define>
47
48     <rng:define name="assert">
49         <rng:element name="assert">
50             <rng:attribute name="model" />
51             <rng:optional><rng:attribute name="search" /></rng:optional>
52             <rng:optional><rng:attribute name="count" /></rng:optional>
53             <rng:optional><rng:attribute name="string" /></rng:optional>
54             <rng:optional><rng:attribute name="id" /></rng:optional>
55             <rng:optional><rng:attribute name="context" /></rng:optional>
56             <rng:optional><rng:attribute name="severity" /></rng:optional>
57             <rng:zeroOrMore>
58                 <rng:element name="test">
59                     <rng:attribute name="expr"/>
60                     <rng:choice>
61                         <rng:text />
62                         <rng:empty />
63                     </rng:choice>
64                 </rng:element>
65             </rng:zeroOrMore>
66         </rng:element>
67     </rng:define>
68
69     <rng:define name="workflow">
70         <rng:element name="workflow">
71             <rng:attribute name="model" />
72             <rng:optional><rng:attribute name="ref" /></rng:optional>
73             <rng:attribute name="action"/>
74             <rng:optional><rng:attribute name="uid"/></rng:optional>
75             <rng:optional><rng:attribute name="context" /></rng:optional>
76             <rng:choice>
77                 <rng:empty/>
78                 <rng:ref name="value"/>
79             </rng:choice>
80         </rng:element>
81     </rng:define>
82
83     <rng:define name="wizard">
84         <rng:element name="wizard">
85             <rng:attribute name="name"/>
86             <rng:attribute name="id" />
87             <rng:optional><rng:attribute name="menu" /></rng:optional>
88             <rng:optional><rng:attribute name="model" /></rng:optional>
89             <rng:attribute name="string" />
90             <rng:optional><rng:attribute name="keyword" /></rng:optional>
91             <rng:optional><rng:attribute name="multi" /></rng:optional>
92             <rng:optional><rng:attribute name="client_action_multi" /></rng:optional>
93             <rng:optional> <rng:attribute name="groups"/> </rng:optional>
94         </rng:element>
95     </rng:define>
96
97     <rng:define name="report">
98         <rng:element name="report">
99             <rng:optional><rng:attribute name="id"/></rng:optional>
100             <rng:attribute name="string"/>
101             <rng:attribute name="model"/>
102             <rng:attribute name="name"/>
103             <rng:optional><rng:attribute name="report_type"/></rng:optional>
104             <rng:optional><rng:attribute name="multi"/></rng:optional>
105             <rng:optional><rng:attribute name="menu"/></rng:optional>
106             <rng:optional><rng:attribute name="keyword"/></rng:optional>
107             <rng:optional><rng:attribute name="rml"/></rng:optional>
108             <rng:optional><rng:attribute name="sxw"/></rng:optional>
109             <rng:optional><rng:attribute name="xml"/></rng:optional>
110             <rng:optional><rng:attribute name="xsl"/></rng:optional>
111             <rng:optional> <rng:attribute name="auto" /> </rng:optional>
112             <rng:optional> <rng:attribute name="header" /> </rng:optional>
113             <rng:optional> <rng:attribute name="attachment" /> </rng:optional>
114             <rng:optional> <rng:attribute name="attachment_use" /> </rng:optional>
115             <rng:optional> <rng:attribute name="groups"/> </rng:optional>
116             <rng:empty />
117         </rng:element>
118     </rng:define>
119
120     <rng:define name="field">
121         <rng:element name="field">
122             <rng:attribute name="name" />
123             <rng:optional><rng:attribute name="type"/></rng:optional>
124             <rng:optional><rng:attribute name="ref"/></rng:optional>
125             <rng:optional><rng:attribute name="eval"/></rng:optional>
126             <rng:optional><rng:attribute name="domain"/></rng:optional>
127             <rng:optional><rng:attribute name="search"/></rng:optional>
128             <rng:optional><rng:attribute name="model"/></rng:optional>
129             <rng:optional><rng:attribute name="use"/></rng:optional>
130             <rng:oneOrMore>
131                 <rng:choice>
132                     <rng:ref name="any"/>
133                     <rng:text/>
134                 </rng:choice>
135             </rng:oneOrMore>
136         </rng:element>
137     </rng:define>
138
139
140     <rng:define name="record">
141         <rng:element name="record">
142             <rng:optional><rng:attribute name="id" /> </rng:optional>
143             <rng:attribute name="model" />
144             <rng:optional><rng:attribute name="forcecreate" /></rng:optional>
145             <rng:zeroOrMore>
146                 <rng:ref name="field" />
147             </rng:zeroOrMore>
148             <rng:optional><rng:attribute name="context"/></rng:optional>
149         </rng:element>
150     </rng:define>
151
152     <rng:define name="delete">
153         <rng:element name="delete">
154             <rng:attribute name="model" />
155                 <rng:choice>
156                     <rng:attribute name="id" />
157                     <rng:attribute name="search" />
158                 </rng:choice>
159             </rng:element>
160     </rng:define>
161
162     <rng:define name="ir_set">
163         <rng:element name="ir_set">
164             <rng:oneOrMore>
165                 <rng:ref name="field" />
166             </rng:oneOrMore>
167         </rng:element>
168     </rng:define>
169
170     <rng:define name="menuitem">
171         <rng:element name="menuitem">
172             <!-- L'identifiant devrait être obligatoire -->
173             <rng:optional> <rng:attribute name="id" /></rng:optional>
174             <!-- Attention le nom peut disparaitre uniquement si le parent est présent -->
175             <rng:optional> <rng:attribute name="name"/></rng:optional>
176             <rng:optional> <rng:attribute name="parent"/> </rng:optional>
177             <rng:optional> <rng:attribute name="icon"/> </rng:optional>
178             <rng:optional> <rng:attribute name="action"/> </rng:optional>
179             <rng:optional> <rng:attribute name="string"/> </rng:optional>
180             <rng:optional> <rng:attribute name="sequence"/> </rng:optional>
181             <rng:optional> <rng:attribute name="groups"/> </rng:optional>
182             <rng:optional> <rng:attribute name="type"/> </rng:optional>
183             <rng:optional> <rng:attribute name="menu"/> </rng:optional>
184             <rng:empty />
185         </rng:element>
186     </rng:define>
187
188     <rng:define name="act_window">
189         <rng:element name="act_window">
190             <rng:attribute name="id" />
191             <rng:attribute name="name" />
192             <rng:attribute name="res_model" />
193             <rng:optional><rng:attribute name="domain" /> </rng:optional>
194             <rng:optional><rng:attribute name="src_model" /></rng:optional>
195             <rng:optional><rng:attribute name="context" /></rng:optional>
196             <rng:optional> <rng:attribute name="view"/> </rng:optional>
197             <rng:optional> <rng:attribute name="view_id"/> </rng:optional>
198             <rng:optional> <rng:attribute name="view_type"/> </rng:optional>
199             <rng:optional> <rng:attribute name="view_mode"/> </rng:optional>
200             <rng:optional> <rng:attribute name="multi"/> </rng:optional>
201             <rng:optional> <rng:attribute name="target"/> </rng:optional>
202             <rng:optional> <rng:attribute name="key2"/> </rng:optional>
203             <rng:optional> <rng:attribute name="groups"/> </rng:optional>
204             <rng:optional> <rng:attribute name="limit"/> </rng:optional>
205             <rng:optional> <rng:attribute name="usage"/> </rng:optional>
206             <rng:optional> <rng:attribute name="auto_refresh"/> </rng:optional>
207             <rng:empty />
208         </rng:element>
209     </rng:define>
210
211     <rng:define name="data">
212         <rng:element name="data">
213             <rng:optional><rng:attribute name="noupdate" /></rng:optional>
214             <rng:optional><rng:attribute name="context" /></rng:optional>
215             <rng:zeroOrMore>
216                 <rng:choice>
217                     <rng:text/>
218                     <rng:ref name="menuitem" />
219                     <rng:ref name="record" />
220                     <rng:ref name="delete" />
221                     <rng:ref name="wizard" />
222                     <rng:ref name="act_window" />
223                     <rng:ref name="assert" />
224                     <rng:ref name="report" />
225                     <rng:ref name="workflow" />
226                     <rng:ref name="function" />
227                     <rng:ref name="ir_set" />
228                 </rng:choice>
229             </rng:zeroOrMore>
230         </rng:element>
231     </rng:define>
232
233     <rng:start>
234         <rng:choice>
235             <rng:element name="openerp">
236                 <rng:oneOrMore>
237                     <rng:ref name="data" />
238                 </rng:oneOrMore>
239             </rng:element>
240             <rng:element name="terp">
241                 <rng:oneOrMore>
242                     <rng:ref name="data" />
243                 </rng:oneOrMore>
244             </rng:element>
245         </rng:choice>
246     </rng:start>
247 </rng:grammar>