scxml-core-strict.xsd 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  3. targetNamespace="http://www.w3.org/2005/07/scxml"
  4. xmlns="http://www.w3.org/2005/07/scxml"
  5. elementFormDefault="qualified">
  6. <xsd:annotation>
  7. <xsd:documentation>
  8. This is the XML Schema core module for SCXML
  9. * scxml
  10. * state
  11. * initial
  12. * onexit
  13. * onentry
  14. * transition
  15. * parallel
  16. * final
  17. * history
  18. * donedata
  19. * if
  20. * elsif
  21. * else
  22. * foreach
  23. * raise
  24. * log
  25. The core module defines these elements and the
  26. attributes.
  27. </xsd:documentation>
  28. <xsd:documentation source="scxml-copyright.xsd"/>
  29. </xsd:annotation>
  30. <xsd:include schemaLocation="scxml-datatypes.xsd">
  31. <xsd:annotation>
  32. <xsd:documentation>
  33. Includes common SCXML datatypes
  34. </xsd:documentation>
  35. </xsd:annotation>
  36. </xsd:include>
  37. <xsd:include schemaLocation="scxml-attribs.xsd">
  38. <xsd:annotation>
  39. <xsd:documentation>
  40. Includes common SCXML attributes
  41. </xsd:documentation>
  42. </xsd:annotation>
  43. </xsd:include>
  44. <xsd:include schemaLocation="scxml-contentmodels.xsd">
  45. <xsd:annotation>
  46. <xsd:documentation>
  47. This module defines Common content model extensions for SCXML
  48. </xsd:documentation>
  49. </xsd:annotation>
  50. </xsd:include>
  51. <!-- scxml -->
  52. <xsd:attributeGroup name="scxml.scxml.attlist">
  53. <xsd:attribute name="initial" type="xsd:IDREFS"/>
  54. <xsd:attribute name="name" type="xsd:NMTOKEN"/>
  55. <xsd:attribute name="version" type="xsd:decimal" use="required" fixed="1.0"/>
  56. <xsd:attribute name="datamodel" type="xsd:NMTOKEN" default="null" use="optional"/>
  57. <xsd:attribute name="binding" type="Binding.datatype"/>
  58. <xsd:attribute name="exmode" type="Exmode.datatype"/>
  59. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  60. </xsd:attributeGroup>
  61. <xsd:group name="scxml.scxml.mix">
  62. <xsd:choice>
  63. <xsd:element ref="state" minOccurs="0" maxOccurs="unbounded"/>
  64. <xsd:element ref="parallel" minOccurs="0" maxOccurs="unbounded"/>
  65. <xsd:element ref="final" minOccurs="0" maxOccurs="unbounded"/>
  66. <xsd:element ref="datamodel" minOccurs="0" maxOccurs="unbounded"/>
  67. <xsd:element ref="script" minOccurs="0" maxOccurs="unbounded"/>
  68. <xsd:group ref="scxml.extra.content" minOccurs="0" maxOccurs="unbounded"/>
  69. </xsd:choice>
  70. </xsd:group>
  71. <xsd:group name="scxml.scxml.content">
  72. <xsd:sequence>
  73. <xsd:group ref="scxml.scxml.mix" minOccurs="0" maxOccurs="unbounded"/>
  74. </xsd:sequence>
  75. </xsd:group>
  76. <xsd:complexType name="scxml.scxml.type">
  77. <xsd:group ref="scxml.scxml.content"/>
  78. <xsd:attributeGroup ref="scxml.scxml.attlist"/>
  79. </xsd:complexType>
  80. <xsd:element name="scxml" type="scxml.scxml.type"/>
  81. <!-- state -->
  82. <xsd:attributeGroup name="scxml.state.attlist">
  83. <xsd:attribute name="id" type="xsd:ID"/>
  84. <xsd:attribute name="initial" type="xsd:IDREFS"/>
  85. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  86. </xsd:attributeGroup>
  87. <xsd:group name="scxml.state.mix">
  88. <xsd:choice>
  89. <xsd:element ref="onentry" minOccurs="0" maxOccurs="unbounded"/>
  90. <xsd:element ref="onexit" minOccurs="0" maxOccurs="unbounded"/>
  91. <xsd:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
  92. <xsd:element ref="initial" minOccurs="0" maxOccurs="1"/>
  93. <xsd:element ref="state" minOccurs="0" maxOccurs="unbounded"/>
  94. <xsd:element ref="parallel" minOccurs="0" maxOccurs="unbounded"/>
  95. <xsd:element ref="final" minOccurs="0" maxOccurs="unbounded"/>
  96. <xsd:element ref="history" minOccurs="0" maxOccurs="unbounded"/>
  97. <xsd:element ref="datamodel" minOccurs="0" maxOccurs="1"/>
  98. <xsd:element ref="invoke" minOccurs="0" maxOccurs="unbounded"/>
  99. <xsd:group ref="scxml.extra.content" minOccurs="0" maxOccurs="unbounded"/>
  100. </xsd:choice>
  101. </xsd:group>
  102. <xsd:group name="scxml.state.content">
  103. <xsd:sequence>
  104. <xsd:group ref="scxml.state.mix" minOccurs="0" maxOccurs="unbounded"/>
  105. </xsd:sequence>
  106. </xsd:group>
  107. <xsd:complexType name="scxml.state.type">
  108. <xsd:sequence>
  109. <xsd:group ref="scxml.state.content"/>
  110. </xsd:sequence>
  111. <xsd:attributeGroup ref="scxml.state.attlist"/>
  112. <xsd:assert test="not(@initial and initial)" xpathDefaultNamespace="##targetNamespace"/>
  113. <xsd:assert test="if(@initial or initial) then (state | parallel) else true()" xpathDefaultNamespace="##targetNamespace"/>
  114. <xsd:assert test="every $init in @initial satisfies (some $state in (.//state | .//parallel) satisfies ($state/@id = $init))" xpathDefaultNamespace="##targetNamespace"/>
  115. <xsd:assert test="if (initial) then (every $targ in initial/transition/@target satisfies (some $state in (.//state | .//parallel) satisfies ($state/@id = $targ))) else true()" xpathDefaultNamespace="##targetNamespace"/>
  116. <xsd:assert test="if(history/@type='shallow') then (every $targ in history/transition/@target satisfies
  117. (some $state in (state |parallel) satisfies ($state/@id = $targ)))
  118. else if (history/@type='deep') then (every $targ in history/transition/@target satisfies
  119. (some $state in (.//state | .//parallel) satisfies ($state/@id = $targ)))
  120. else true()" xpathDefaultNamespace="##targetNamespace"/>
  121. </xsd:complexType>
  122. <xsd:element name="state" type="scxml.state.type"/>
  123. <!-- initial -->
  124. <xsd:attributeGroup name="scxml.initial.attlist">
  125. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  126. </xsd:attributeGroup>
  127. <xsd:group name="scxml.initial.content">
  128. <xsd:sequence>
  129. <xsd:group ref="scxml.extra.content" minOccurs="0" maxOccurs="unbounded"/>
  130. <xsd:element ref="transition" minOccurs="1" maxOccurs="1"/>
  131. <xsd:group ref="scxml.extra.content" minOccurs="0" maxOccurs="unbounded"/>
  132. </xsd:sequence>
  133. </xsd:group>
  134. <xsd:complexType name="scxml.initial.type">
  135. <xsd:group ref="scxml.initial.content"/>
  136. <xsd:attributeGroup ref="scxml.initial.attlist"/>
  137. </xsd:complexType>
  138. <xsd:element name="initial" type="scxml.initial.type"/>
  139. <!-- onentry -->
  140. <xsd:attributeGroup name="scxml.onentry.attlist">
  141. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  142. </xsd:attributeGroup>
  143. <xsd:group name="scxml.onentry.content">
  144. <xsd:sequence>
  145. <xsd:group ref="scxml.core.executablecontent" minOccurs="0" maxOccurs="unbounded"/>
  146. </xsd:sequence>
  147. </xsd:group>
  148. <xsd:complexType name="scxml.onentry.type">
  149. <xsd:group ref="scxml.onentry.content"/>
  150. <xsd:attributeGroup ref="scxml.onentry.attlist"/>
  151. </xsd:complexType>
  152. <xsd:element name="onentry" type="scxml.onentry.type"/>
  153. <!-- onexit -->
  154. <xsd:attributeGroup name="scxml.onexit.attlist">
  155. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  156. </xsd:attributeGroup>
  157. <xsd:group name="scxml.onexit.content">
  158. <xsd:sequence>
  159. <xsd:group ref="scxml.core.executablecontent" minOccurs="0" maxOccurs="unbounded"/>
  160. </xsd:sequence>
  161. </xsd:group>
  162. <xsd:complexType name="scxml.onexit.type">
  163. <xsd:group ref="scxml.onexit.content"/>
  164. <xsd:attributeGroup ref="scxml.onexit.attlist"/>
  165. </xsd:complexType>
  166. <xsd:element name="onexit" type="scxml.onexit.type"/>
  167. <!-- transition -->
  168. <xsd:attributeGroup name="scxml.transition.attlist">
  169. <xsd:attribute name="event" type="EventTypes.datatype"/>
  170. <xsd:attribute name="cond" type="CondLang.datatype"/>
  171. <xsd:attribute name="target" type="xsd:IDREFS"/>
  172. <xsd:attribute name="type" type="TransitionType.datatype"/>
  173. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  174. </xsd:attributeGroup>
  175. <xsd:group name="scxml.transition.content">
  176. <xsd:sequence>
  177. <xsd:group ref="scxml.core.executablecontent" minOccurs="0" maxOccurs="unbounded"/>
  178. </xsd:sequence>
  179. </xsd:group>
  180. <xsd:complexType name="scxml.transition.type">
  181. <xsd:group ref="scxml.transition.content"/>
  182. <xsd:attributeGroup ref="scxml.transition.attlist"/>
  183. <xsd:assert test="(@event or @cond or @target)" xpathDefaultNamespace="##targetNamespace"/>
  184. </xsd:complexType>
  185. <xsd:element name="transition" type="scxml.transition.type"/>
  186. <!-- parallel -->
  187. <xsd:attributeGroup name="scxml.parallel.attlist">
  188. <xsd:attribute name="id" type="xsd:ID"/>
  189. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  190. </xsd:attributeGroup>
  191. <xsd:group name="scxml.parallel.mix">
  192. <xsd:choice>
  193. <xsd:element ref="onentry" minOccurs="0" maxOccurs="unbounded"/>
  194. <xsd:element ref="onexit" minOccurs="0" maxOccurs="unbounded"/>
  195. <xsd:element ref="transition" minOccurs="0" maxOccurs="unbounded"/>
  196. <xsd:element ref="state" minOccurs="0" maxOccurs="unbounded"/>
  197. <xsd:element ref="parallel" minOccurs="0" maxOccurs="unbounded"/>
  198. <xsd:element ref="history" minOccurs="0" maxOccurs="unbounded"/>
  199. <xsd:element ref="datamodel" minOccurs="0" maxOccurs="1"/>
  200. <xsd:element ref="invoke" minOccurs="0" maxOccurs="unbounded"/>
  201. <xsd:group ref="scxml.extra.content" minOccurs="0" maxOccurs="unbounded"/>
  202. </xsd:choice>
  203. </xsd:group>
  204. <xsd:group name="scxml.parallel.content">
  205. <xsd:sequence>
  206. <xsd:group ref="scxml.parallel.mix" minOccurs="0" maxOccurs="unbounded"/>
  207. </xsd:sequence>
  208. </xsd:group>
  209. <xsd:complexType name="scxml.parallel.type">
  210. <xsd:group ref="scxml.parallel.content"/>
  211. <xsd:attributeGroup ref="scxml.parallel.attlist"/>
  212. <xsd:assert test="if(history/@type='shallow') then (every $targ in history/transition/@target satisfies
  213. (some $state in (state |parallel) satisfies ($state/@id = $targ)))
  214. else if (history/@type='deep') then (every $targ in history/transition/@target satisfies
  215. (some $state in (.//state | .//parallel) satisfies ($state/@id = $targ)))
  216. else true()" xpathDefaultNamespace="##targetNamespace"/>
  217. </xsd:complexType>
  218. <xsd:element name="parallel" type="scxml.parallel.type"/>
  219. <!-- final -->
  220. <xsd:attributeGroup name="scxml.final.attlist">
  221. <xsd:attribute name="id" type="xsd:ID"/>
  222. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  223. </xsd:attributeGroup>
  224. <xsd:group name="scxml.final.mix">
  225. <xsd:choice>
  226. <xsd:element ref="onentry" minOccurs="0" maxOccurs="unbounded"/>
  227. <xsd:element ref="onexit" minOccurs="0" maxOccurs="unbounded"/>
  228. <xsd:element ref="donedata" minOccurs="0" maxOccurs="1"/>
  229. <xsd:group ref="scxml.extra.content" minOccurs="0" maxOccurs="unbounded"/>
  230. </xsd:choice>
  231. </xsd:group>
  232. <xsd:group name="scxml.final.content">
  233. <xsd:sequence>
  234. <xsd:group ref="scxml.final.mix" minOccurs="0" maxOccurs="unbounded"/>
  235. </xsd:sequence>
  236. </xsd:group>
  237. <xsd:complexType name="scxml.final.type">
  238. <xsd:group ref="scxml.final.content"/>
  239. <xsd:attributeGroup ref="scxml.final.attlist"/>
  240. </xsd:complexType>
  241. <xsd:element name="final" type="scxml.final.type"/>
  242. <!-- history -->
  243. <xsd:attributeGroup name="scxml.history.attlist">
  244. <xsd:attribute name="id" type="xsd:ID"/>
  245. <xsd:attribute name="type" type="HistoryType.datatype"/>
  246. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  247. </xsd:attributeGroup>
  248. <xsd:group name="scxml.history.content">
  249. <xsd:sequence>
  250. <xsd:group ref="scxml.extra.content" minOccurs="0" maxOccurs="unbounded"/>
  251. <xsd:element ref="transition" minOccurs="1" maxOccurs="1"/>
  252. <xsd:group ref="scxml.extra.content" minOccurs="0" maxOccurs="unbounded"/>
  253. </xsd:sequence>
  254. </xsd:group>
  255. <xsd:complexType name="scxml.history.type">
  256. <xsd:group ref="scxml.history.content"/>
  257. <xsd:attributeGroup ref="scxml.history.attlist"/>
  258. <xsd:assert test="not(transition/@cond or transition/@event)" xpathDefaultNamespace="##targetNamespace"/>
  259. </xsd:complexType>
  260. <xsd:element name="history" type="scxml.history.type"/>
  261. <!-- donedata -->
  262. <xsd:attributeGroup name="scxml.donedata.attlist">
  263. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  264. </xsd:attributeGroup>
  265. <xsd:group name="scxml.donedata.content">
  266. <xsd:sequence>
  267. <xsd:choice>
  268. <xsd:element ref="content" minOccurs="1" maxOccurs="1"/>
  269. <xsd:element ref="param" minOccurs="1" maxOccurs="unbounded"/>
  270. </xsd:choice>
  271. <xsd:group ref="scxml.extra.content" minOccurs="0" maxOccurs="unbounded"/>
  272. </xsd:sequence>
  273. </xsd:group>
  274. <xsd:complexType name="scxml.donedata.type">
  275. <xsd:group ref="scxml.donedata.content"/>
  276. <xsd:attributeGroup ref="scxml.donedata.attlist"/>
  277. </xsd:complexType>
  278. <xsd:element name="donedata" type="scxml.donedata.type"/>
  279. <!-- if -->
  280. <xsd:attributeGroup name="scxml.if.attlist">
  281. <xsd:attribute name="cond" type="CondLang.datatype" use="required"/>
  282. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  283. </xsd:attributeGroup>
  284. <xsd:group name="scxml.if.elseif.mix">
  285. <xsd:sequence>
  286. <xsd:element ref="elseif" />
  287. <xsd:group ref="scxml.core.executablecontent" minOccurs="0" maxOccurs="unbounded"/>
  288. </xsd:sequence>
  289. </xsd:group>
  290. <xsd:group name="scxml.if.else.mix">
  291. <xsd:sequence>
  292. <xsd:element ref="else" />
  293. <xsd:group ref="scxml.core.executablecontent" minOccurs="0" maxOccurs="unbounded"/>
  294. </xsd:sequence>
  295. </xsd:group>
  296. <xsd:group name="scxml.if.content">
  297. <xsd:sequence>
  298. <xsd:group ref="scxml.core.executablecontent" minOccurs="0" maxOccurs="unbounded"/>
  299. <xsd:group ref="scxml.if.elseif.mix" minOccurs="0" maxOccurs="1"/>
  300. <xsd:group ref="scxml.if.else.mix" minOccurs="0" maxOccurs="1"/>
  301. </xsd:sequence>
  302. </xsd:group>
  303. <xsd:complexType name="scxml.if.type">
  304. <xsd:group ref="scxml.if.content"/>
  305. <xsd:attributeGroup ref="scxml.if.attlist"/>
  306. </xsd:complexType>
  307. <xsd:element name="if" type="scxml.if.type"/>
  308. <!-- elseif -->
  309. <xsd:attributeGroup name="scxml.elseif.attlist">
  310. <xsd:attribute name="cond" type="CondLang.datatype" use="required"/>
  311. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  312. </xsd:attributeGroup>
  313. <xsd:group name="scxml.elseif.mix">
  314. <xsd:choice>
  315. <!-- No content for this element -->
  316. </xsd:choice>
  317. </xsd:group>
  318. <xsd:group name="scxml.elseif.content">
  319. <xsd:sequence>
  320. <xsd:group ref="scxml.elseif.mix" minOccurs="0" maxOccurs="unbounded"/>
  321. </xsd:sequence>
  322. </xsd:group>
  323. <xsd:complexType name="scxml.elseif.type">
  324. <xsd:group ref="scxml.elseif.content"/>
  325. <xsd:attributeGroup ref="scxml.elseif.attlist"/>
  326. </xsd:complexType>
  327. <xsd:element name="elseif" type="scxml.elseif.type"/>
  328. <!-- else -->
  329. <xsd:attributeGroup name="scxml.else.attlist">
  330. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  331. </xsd:attributeGroup>
  332. <xsd:group name="scxml.else.mix">
  333. <xsd:choice>
  334. <!-- No content for this element -->
  335. </xsd:choice>
  336. </xsd:group>
  337. <xsd:group name="scxml.else.content">
  338. <xsd:sequence>
  339. <xsd:group ref="scxml.else.mix" minOccurs="0" maxOccurs="unbounded"/>
  340. </xsd:sequence>
  341. </xsd:group>
  342. <xsd:complexType name="scxml.else.type">
  343. <xsd:group ref="scxml.else.content"/>
  344. <xsd:attributeGroup ref="scxml.else.attlist"/>
  345. </xsd:complexType>
  346. <xsd:element name="else" type="scxml.else.type"/>
  347. <!-- foreach -->
  348. <xsd:attributeGroup name="scxml.foreach.attlist">
  349. <xsd:attribute name="array" type="ValueLang.datatype" use="required"/>
  350. <xsd:attribute name="item" type="xsd:string" use="required"/>
  351. <xsd:attribute name="index" type="xsd:string"/>
  352. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  353. </xsd:attributeGroup>
  354. <xsd:group name="scxml.foreach.content">
  355. <xsd:sequence>
  356. <xsd:group ref="scxml.core.executablecontent" minOccurs="0" maxOccurs="unbounded"/>
  357. </xsd:sequence>
  358. </xsd:group>
  359. <xsd:complexType name="scxml.foreach.type">
  360. <xsd:group ref="scxml.foreach.content"/>
  361. <xsd:attributeGroup ref="scxml.foreach.attlist"/>
  362. </xsd:complexType>
  363. <xsd:element name="foreach" type="scxml.foreach.type"/>
  364. <!-- raise -->
  365. <xsd:attributeGroup name="scxml.raise.attlist">
  366. <xsd:attribute name="event" type="xsd:NMTOKEN" use="required"/>
  367. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  368. </xsd:attributeGroup>
  369. <xsd:group name="scxml.raise.mix">
  370. <xsd:choice>
  371. <!-- No content for this element -->
  372. </xsd:choice>
  373. </xsd:group>
  374. <xsd:group name="scxml.raise.content">
  375. <xsd:sequence>
  376. <xsd:group ref="scxml.raise.mix" minOccurs="0" maxOccurs="unbounded"/>
  377. </xsd:sequence>
  378. </xsd:group>
  379. <xsd:complexType name="scxml.raise.type">
  380. <xsd:group ref="scxml.raise.content"/>
  381. <xsd:attributeGroup ref="scxml.raise.attlist"/>
  382. </xsd:complexType>
  383. <xsd:element name="raise" type="scxml.raise.type"/>
  384. <!-- log -->
  385. <xsd:attributeGroup name="scxml.log.attlist">
  386. <xsd:attribute name="label" type="xsd:string"/>
  387. <xsd:attribute name="expr" type="ValueLang.datatype"/>
  388. <xsd:attributeGroup ref="scxml.extra.attribs"/>
  389. </xsd:attributeGroup>
  390. <xsd:group name="scxml.log.content">
  391. <xsd:sequence>
  392. <xsd:group ref="scxml.extra.content" minOccurs="0" maxOccurs="unbounded"/>
  393. </xsd:sequence>
  394. </xsd:group>
  395. <xsd:complexType name="scxml.log.type">
  396. <xsd:group ref="scxml.log.content"/>
  397. <xsd:attributeGroup ref="scxml.log.attlist"/>
  398. </xsd:complexType>
  399. <xsd:element name="log" type="scxml.log.type"/>
  400. </xsd:schema>