import_xml.rng 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <rng:grammar xmlns:rng="http://relaxng.org/ns/structure/1.0"
  3. datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  4. <rng:define name="env">
  5. <rng:optional><rng:attribute name="uid" /></rng:optional>
  6. <rng:optional><rng:attribute name="context" /></rng:optional>
  7. </rng:define>
  8. <rng:define name="views">
  9. <rng:data type="string">
  10. <rng:param name="pattern">([a-z]+(,[a-z]+)*)?</rng:param>
  11. </rng:data>
  12. </rng:define>
  13. <rng:define name="any">
  14. <rng:element>
  15. <rng:anyName/>
  16. <rng:zeroOrMore>
  17. <rng:choice>
  18. <rng:attribute>
  19. <rng:anyName/>
  20. </rng:attribute>
  21. <rng:text/>
  22. <rng:ref name="any"/>
  23. </rng:choice>
  24. </rng:zeroOrMore>
  25. </rng:element>
  26. </rng:define>
  27. <rng:define name="value">
  28. <rng:element name="value">
  29. <rng:optional><rng:attribute name="name" /></rng:optional>
  30. <rng:optional><rng:attribute name="model" /></rng:optional>
  31. <rng:choice>
  32. <rng:attribute name="search" />
  33. <rng:attribute name="eval" />
  34. <rng:group>
  35. <rng:optional><rng:attribute name="type" /></rng:optional>
  36. <rng:choice>
  37. <rng:attribute name="file" />
  38. <rng:text/>
  39. </rng:choice>
  40. </rng:group>
  41. </rng:choice>
  42. <rng:optional><rng:attribute name="use" /></rng:optional>
  43. </rng:element>
  44. </rng:define>
  45. <rng:define name="function">
  46. <rng:element name="function">
  47. <rng:attribute name="model" />
  48. <rng:attribute name="name" />
  49. <rng:ref name="env"/>
  50. <rng:optional>
  51. <rng:choice>
  52. <rng:attribute name="eval" />
  53. <rng:oneOrMore>
  54. <rng:choice>
  55. <rng:ref name="value" />
  56. <rng:ref name="function" />
  57. </rng:choice>
  58. </rng:oneOrMore>
  59. </rng:choice>
  60. </rng:optional>
  61. </rng:element>
  62. </rng:define>
  63. <rng:define name="report">
  64. <rng:element name="report">
  65. <rng:optional><rng:attribute name="id"/></rng:optional>
  66. <rng:attribute name="string"/>
  67. <rng:attribute name="model"/>
  68. <rng:attribute name="name"/>
  69. <rng:optional><rng:attribute name="print_report_name"/></rng:optional>
  70. <rng:optional><rng:attribute name="report_type"/></rng:optional>
  71. <rng:optional><rng:attribute name="multi"/></rng:optional>
  72. <rng:optional><rng:attribute name="menu"/></rng:optional>
  73. <rng:optional><rng:attribute name="keyword"/></rng:optional>
  74. <rng:optional><rng:attribute name="file"/></rng:optional>
  75. <rng:optional><rng:attribute name="xml"/></rng:optional>
  76. <rng:optional><rng:attribute name="parser"/></rng:optional>
  77. <rng:optional> <rng:attribute name="auto" /> </rng:optional>
  78. <rng:optional> <rng:attribute name="header" /> </rng:optional>
  79. <rng:optional> <rng:attribute name="attachment" /> </rng:optional>
  80. <rng:optional> <rng:attribute name="attachment_use" /> </rng:optional>
  81. <rng:optional> <rng:attribute name="groups"/> </rng:optional>
  82. <rng:optional> <rng:attribute name="paperformat"/> </rng:optional>
  83. <!-- `Usage` may help identify the best report for a certain task,
  84. for example usage="default" for reports that are attached by
  85. default in EDI exports -->
  86. <rng:optional><rng:attribute name="usage"/></rng:optional>
  87. <rng:empty />
  88. </rng:element>
  89. </rng:define>
  90. <rng:define name="field">
  91. <rng:element name="field">
  92. <rng:attribute name="name" />
  93. <rng:choice>
  94. <rng:group>
  95. <rng:attribute name="type">
  96. <rng:choice>
  97. <rng:value>base64</rng:value>
  98. <rng:value>char</rng:value>
  99. <rng:value>file</rng:value>
  100. </rng:choice>
  101. </rng:attribute>
  102. <rng:choice>
  103. <rng:group>
  104. <rng:attribute name="file"/>
  105. <rng:empty/>
  106. </rng:group>
  107. <rng:text/>
  108. </rng:choice>
  109. </rng:group>
  110. <rng:group>
  111. <rng:attribute name="type"><rng:value>int</rng:value></rng:attribute>
  112. <rng:choice>
  113. <rng:data type="int"/>
  114. <rng:value>None</rng:value>
  115. </rng:choice>
  116. </rng:group>
  117. <rng:group>
  118. <rng:attribute name="type"><rng:value>float</rng:value></rng:attribute>
  119. <rng:data type="float"/>
  120. </rng:group>
  121. <rng:group>
  122. <rng:attribute name="type">
  123. <rng:choice>
  124. <rng:value>list</rng:value>
  125. <rng:value>tuple</rng:value>
  126. </rng:choice>
  127. </rng:attribute>
  128. <rng:oneOrMore><rng:ref name="value"/></rng:oneOrMore>
  129. </rng:group>
  130. <rng:group>
  131. <rng:attribute name="type">
  132. <rng:choice>
  133. <rng:value>html</rng:value>
  134. <rng:value>xml</rng:value>
  135. </rng:choice>
  136. </rng:attribute>
  137. <rng:oneOrMore>
  138. <rng:ref name="any"/>
  139. </rng:oneOrMore>
  140. </rng:group>
  141. <rng:group>
  142. <rng:attribute name="ref"/>
  143. <rng:empty/>
  144. </rng:group>
  145. <rng:group>
  146. <rng:attribute name="eval"/>
  147. <rng:optional><rng:attribute name="model"/></rng:optional>
  148. <rng:empty/>
  149. </rng:group>
  150. <rng:group>
  151. <rng:attribute name="search"/>
  152. <rng:optional><rng:attribute name="model"/></rng:optional>
  153. <rng:optional><rng:attribute name="use"/></rng:optional>
  154. <rng:empty/>
  155. </rng:group>
  156. <rng:text/>
  157. <rng:zeroOrMore>
  158. <rng:ref name="record" />
  159. </rng:zeroOrMore>
  160. </rng:choice>
  161. </rng:element>
  162. </rng:define>
  163. <rng:define name="record">
  164. <rng:element name="record">
  165. <rng:optional>
  166. <rng:attribute name="id" />
  167. <rng:optional>
  168. <rng:attribute name="forcecreate" />
  169. </rng:optional>
  170. </rng:optional>
  171. <rng:attribute name="model" />
  172. <rng:ref name="env"/>
  173. <rng:zeroOrMore>
  174. <rng:ref name="field" />
  175. </rng:zeroOrMore>
  176. </rng:element>
  177. </rng:define>
  178. <rng:define name="template">
  179. <rng:element name="template">
  180. <rng:optional><rng:attribute name="id"/></rng:optional>
  181. <rng:optional><rng:attribute name="t-name"/></rng:optional>
  182. <rng:optional><rng:attribute name="name"/></rng:optional>
  183. <rng:optional><rng:attribute name="forcecreate"/></rng:optional>
  184. <rng:optional><rng:attribute name="context"/></rng:optional>
  185. <rng:optional><rng:attribute name="priority"/></rng:optional>
  186. <rng:optional><rng:attribute name="key"/></rng:optional>
  187. <rng:optional><rng:attribute name="website_id"/></rng:optional>
  188. <rng:optional><rng:attribute name="track"/></rng:optional>
  189. <rng:group>
  190. <rng:optional>
  191. <rng:attribute name="inherit_id"/>
  192. <rng:optional>
  193. <rng:attribute name="primary">
  194. <rng:value>True</rng:value>
  195. </rng:attribute>
  196. </rng:optional>
  197. </rng:optional>
  198. <rng:optional><rng:attribute name="groups"/></rng:optional>
  199. <rng:optional><rng:attribute name="active"></rng:attribute></rng:optional>
  200. <rng:optional><rng:attribute name="customize_show"></rng:attribute></rng:optional>
  201. </rng:group>
  202. <rng:zeroOrMore>
  203. <rng:choice>
  204. <rng:text/>
  205. <rng:ref name="any"/>
  206. </rng:choice>
  207. </rng:zeroOrMore>
  208. </rng:element>
  209. </rng:define>
  210. <rng:define name="delete">
  211. <rng:element name="delete">
  212. <rng:attribute name="model" />
  213. <rng:choice>
  214. <rng:attribute name="id" />
  215. <rng:attribute name="search" />
  216. </rng:choice>
  217. </rng:element>
  218. </rng:define>
  219. <rng:define name="menuitem_attrs">
  220. <rng:attribute name="id" />
  221. <rng:optional><rng:attribute name="name"/></rng:optional>
  222. <rng:optional>
  223. <rng:attribute name="sequence">
  224. <rng:data type="int"/>
  225. </rng:attribute>
  226. </rng:optional>
  227. <rng:optional><rng:attribute name="groups"/></rng:optional>
  228. <rng:optional><rng:attribute name="active"/></rng:optional>
  229. </rng:define>
  230. <rng:define name="submenuitem_contents">
  231. <rng:optional>
  232. <rng:choice>
  233. <rng:attribute name="action"/>
  234. <rng:oneOrMore>
  235. <rng:ref name="submenuitem"/>
  236. </rng:oneOrMore>
  237. </rng:choice>
  238. </rng:optional>
  239. </rng:define>
  240. <rng:define name="menuitem">
  241. <rng:element name="menuitem">
  242. <rng:ref name="menuitem_attrs"/>
  243. <rng:choice>
  244. <!-- a root menu can have a web_icon, an action and children -->
  245. <rng:group>
  246. <rng:optional><rng:attribute name="web_icon"/></rng:optional>
  247. <rng:optional><rng:attribute name="action"/></rng:optional>
  248. <rng:zeroOrMore><rng:ref name="submenuitem"/></rng:zeroOrMore>
  249. </rng:group>
  250. <!-- a non-root menu can have a parent and either an action or submenus -->
  251. <rng:group>
  252. <rng:attribute name="parent"/>
  253. <rng:ref name="submenuitem_contents"/>
  254. </rng:group>
  255. </rng:choice>
  256. </rng:element>
  257. </rng:define>
  258. <rng:define name="submenuitem">
  259. <rng:element name="menuitem">
  260. <rng:ref name="menuitem_attrs"/>
  261. <rng:ref name="submenuitem_contents"/>
  262. </rng:element>
  263. </rng:define>
  264. <rng:define name="act_window">
  265. <rng:element name="act_window">
  266. <rng:attribute name="id" />
  267. <rng:attribute name="name" />
  268. <rng:attribute name="res_model" />
  269. <rng:optional><rng:attribute name="domain" /> </rng:optional>
  270. <rng:optional><rng:attribute name="context" /></rng:optional>
  271. <rng:optional> <rng:attribute name="view_id"/> </rng:optional>
  272. <rng:optional> <rng:attribute name="view_mode"/> </rng:optional>
  273. <rng:optional> <rng:attribute name="target"/> </rng:optional>
  274. <rng:optional> <rng:attribute name="groups"/> </rng:optional>
  275. <rng:optional> <rng:attribute name="limit"/> </rng:optional>
  276. <rng:optional> <rng:attribute name="usage"/> </rng:optional>
  277. <rng:optional>
  278. <rng:attribute name="binding_model"/>
  279. <rng:optional>
  280. <rng:attribute name="binding_type">
  281. <rng:choice>
  282. <rng:value>action</rng:value>
  283. <rng:value>report</rng:value>
  284. </rng:choice>
  285. </rng:attribute>
  286. </rng:optional>
  287. <rng:optional>
  288. <rng:attribute name="binding_views">
  289. <rng:ref name="views"/>
  290. </rng:attribute>
  291. </rng:optional>
  292. </rng:optional>
  293. <rng:empty />
  294. </rng:element>
  295. </rng:define>
  296. <rng:define name="odoo_openerp_data">
  297. <rng:element>
  298. <rng:choice>
  299. <rng:name>odoo</rng:name>
  300. <rng:name>openerp</rng:name>
  301. <rng:name>data</rng:name>
  302. </rng:choice>
  303. <rng:optional><rng:attribute name="noupdate" /></rng:optional>
  304. <rng:ref name="env"/>
  305. <rng:zeroOrMore>
  306. <rng:choice>
  307. <rng:text/>
  308. <rng:ref name="odoo_openerp_data"/>
  309. <rng:ref name="menuitem" />
  310. <rng:ref name="record" />
  311. <rng:ref name="template" />
  312. <rng:ref name="delete" />
  313. <rng:ref name="act_window" />
  314. <rng:ref name="report" />
  315. <rng:ref name="function" />
  316. </rng:choice>
  317. </rng:zeroOrMore>
  318. </rng:element>
  319. </rng:define>
  320. <rng:start>
  321. <rng:ref name="odoo_openerp_data"/>
  322. </rng:start>
  323. </rng:grammar>