ezxml_schema_lose.rng 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <grammar ns="http://ez.no/namespaces/ezpublish3" xmlns:xhtml="http://ez.no/namespaces/ezpublish3/xhtml/" xmlns:image="http://ez.no/namespaces/ezpublish3/image/" xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="">
  3. <start>
  4. <element name="section">
  5. <zeroOrMore>
  6. <ref name="sectionContent"/>
  7. </zeroOrMore>
  8. </element>
  9. </start>
  10. <define name="sectionContent">
  11. <choice>
  12. <!-- From documentation -->
  13. <element name="h">
  14. <ref name="headerContent"/>
  15. </element>
  16. <element name="p">
  17. <ref name="paragraphContent"/>
  18. </element>
  19. <!-- From ezxml schema -->
  20. <element name="section">
  21. <oneOrMore>
  22. <ref name="sectionContent"/>
  23. </oneOrMore>
  24. </element>
  25. <element name="paragraph">
  26. <ref name="paragraphContent"/>
  27. </element>
  28. <element name="header">
  29. <ref name="headerContent"/>
  30. </element>
  31. <!-- Not documented at all, but some documents do not contain wrapping paragraphs -->
  32. <ref name="inlineContent"/>
  33. </choice>
  34. </define>
  35. <define name="headerContent">
  36. <optional>
  37. <!-- From documentation -->
  38. <attribute name="custom_parameter">
  39. <data type="string"/>
  40. </attribute>
  41. </optional>
  42. <optional>
  43. <attribute name="anchor">
  44. <data type="string"/>
  45. </attribute>
  46. </optional>
  47. <optional>
  48. <!-- From ezxml schema -->
  49. <attribute name="anchor_name">
  50. <data type="string"/>
  51. </attribute>
  52. </optional>
  53. <optional>
  54. <attribute name="level">
  55. <data type="string"/>
  56. </attribute>
  57. </optional>
  58. <optional>
  59. <attribute name="class">
  60. <data type="string"/>
  61. </attribute>
  62. </optional>
  63. <choice>
  64. <!-- Not documented at all -->
  65. <ref name="inlineContent"/>
  66. <!-- From ezxml schema -->
  67. <text/>
  68. </choice>
  69. </define>
  70. <define name="paragraphContent">
  71. <optional>
  72. <!-- From documentation -->
  73. <attribute name="custom_parameter">
  74. <data type="string"/>
  75. </attribute>
  76. </optional>
  77. <optional>
  78. <!-- From ezxml schema -->
  79. <attribute name="class">
  80. <data type="string"/>
  81. </attribute>
  82. </optional>
  83. <oneOrMore>
  84. <choice>
  85. <!-- Not documented at all -->
  86. <element name="object">
  87. <ref name="embedAttributes"/>
  88. </element>
  89. <element name="custom">
  90. <ref name="customContent"/>
  91. </element>
  92. <!-- From ezxml schema -->
  93. <ref name="inlineContent"/>
  94. <element name="line">
  95. <ref name="inlineContent"/>
  96. </element>
  97. <element name="embed">
  98. <ref name="embedAttributes"/>
  99. </element>
  100. <element name="ol">
  101. <ref name="listContent"/>
  102. </element>
  103. <element name="ul">
  104. <ref name="listContent"/>
  105. </element>
  106. <element name="custom">
  107. <ref name="customContent"/>
  108. </element>
  109. <element name="literal">
  110. <optional>
  111. <!-- From ezxml schema -->
  112. <attribute name="class">
  113. <data type="string"/>
  114. </attribute>
  115. </optional>
  116. <text/>
  117. </element>
  118. <element name="table">
  119. <ref name="tableContent"/>
  120. </element>
  121. </choice>
  122. </oneOrMore>
  123. </define>
  124. <define name="customContent">
  125. <optional>
  126. <!-- Just guessed, not documented at all: -->
  127. <attribute name="custom_parameter">
  128. <data type="string"/>
  129. </attribute>
  130. </optional>
  131. <attribute name="name">
  132. <data type="string"/>
  133. </attribute>
  134. <optional>
  135. <attribute name="custom:header">
  136. <data type="string"/>
  137. </attribute>
  138. </optional>
  139. <optional>
  140. <attribute name="custom:link">
  141. <data type="string"/>
  142. </attribute>
  143. </optional>
  144. <optional>
  145. <attribute name="custom:class">
  146. <data type="string"/>
  147. </attribute>
  148. </optional>
  149. <optional>
  150. <attribute name="custom:package_name">
  151. <data type="string"/>
  152. </attribute>
  153. </optional>
  154. <optional>
  155. <attribute name="custom:version">
  156. <data type="string"/>
  157. </attribute>
  158. </optional>
  159. <optional>
  160. <attribute name="custom:type">
  161. <data type="string"/>
  162. </attribute>
  163. </optional>
  164. <optional>
  165. <attribute name="custom:summary">
  166. <data type="string"/>
  167. </attribute>
  168. </optional>
  169. <optional>
  170. <attribute name="custom:description">
  171. <data type="string"/>
  172. </attribute>
  173. </optional>
  174. <optional>
  175. <attribute name="custom:url">
  176. <data type="string"/>
  177. </attribute>
  178. </optional>
  179. <optional>
  180. <attribute name="custom:thumbnail_url">
  181. <data type="string"/>
  182. </attribute>
  183. </optional>
  184. <optional>
  185. <attribute name="custom:min-version">
  186. <data type="string"/>
  187. </attribute>
  188. </optional>
  189. <optional>
  190. <attribute name="custom:feedurl">
  191. <data type="string"/>
  192. </attribute>
  193. </optional>
  194. <optional>
  195. <attribute name="custom:siteurl">
  196. <data type="string"/>
  197. </attribute>
  198. </optional>
  199. <optional>
  200. <attribute name="custom:limit">
  201. <data type="string"/>
  202. </attribute>
  203. </optional>
  204. <optional>
  205. <attribute name="custom:preselect">
  206. <data type="string"/>
  207. </attribute>
  208. </optional>
  209. <zeroOrMore>
  210. <choice>
  211. <!-- More or less anything... -->
  212. <element name="h">
  213. <ref name="headerContent"/>
  214. </element>
  215. <element name="p">
  216. <ref name="paragraphContent"/>
  217. </element>
  218. <element name="section">
  219. <oneOrMore>
  220. <ref name="sectionContent"/>
  221. </oneOrMore>
  222. </element>
  223. <element name="paragraph">
  224. <ref name="paragraphContent"/>
  225. </element>
  226. <element name="header">
  227. <ref name="headerContent"/>
  228. </element>
  229. <ref name="inlineContent"/>
  230. </choice>
  231. </zeroOrMore>
  232. </define>
  233. <define name="listContent">
  234. <optional>
  235. <attribute name="custom_parameter">
  236. <data type="string"/>
  237. </attribute>
  238. </optional>
  239. <optional>
  240. <attribute name="class">
  241. <data type="string"/>
  242. </attribute>
  243. </optional>
  244. <zeroOrMore>
  245. <element name="li">
  246. <group>
  247. <optional>
  248. <attribute name="custom_parameter">
  249. <data type="string"/>
  250. </attribute>
  251. </optional>
  252. <optional>
  253. <attribute name="class">
  254. <data type="string"/>
  255. </attribute>
  256. </optional>
  257. <oneOrMore>
  258. <choice>
  259. <!-- Not documented at all -->
  260. <element name="line">
  261. <ref name="inlineContent"/>
  262. </element>
  263. <!-- From documentation -->
  264. <element name="p">
  265. <ref name="paragraphContent"/>
  266. </element>
  267. <!-- From ezxml schema -->
  268. <element name="paragraph">
  269. <ref name="paragraphContent"/>
  270. </element>
  271. <ref name="inlineContent"/>
  272. </choice>
  273. <!-- Seldom, but sometimes those elements are even mixed. -->
  274. </oneOrMore>
  275. </group>
  276. <!-- Yes, empty lists are possible. -->
  277. </element>
  278. </zeroOrMore>
  279. </define>
  280. <define name="tableContent">
  281. <optional>
  282. <attribute name="class">
  283. <data type="string"/>
  284. </attribute>
  285. </optional>
  286. <optional>
  287. <attribute name="width">
  288. <data type="string"/>
  289. </attribute>
  290. </optional>
  291. <optional>
  292. <attribute name="border">
  293. <data type="string"/>
  294. </attribute>
  295. </optional>
  296. <oneOrMore>
  297. <element name="tr">
  298. <optional>
  299. <attribute name="class">
  300. <data type="string"/>
  301. </attribute>
  302. </optional>
  303. <zeroOrMore>
  304. <choice>
  305. <element name="td">
  306. <ref name="tableCellContent"/>
  307. </element>
  308. <element name="th">
  309. <ref name="tableCellContent"/>
  310. </element>
  311. </choice>
  312. <!--
  313. Table headers and cells can be mixed in one row.
  314. And there are empty rows used sometimes
  315. -->
  316. </zeroOrMore>
  317. </element>
  318. </oneOrMore>
  319. </define>
  320. <define name="tableCellContent">
  321. <optional>
  322. <attribute name="class">
  323. <data type="string"/>
  324. </attribute>
  325. </optional>
  326. <optional>
  327. <attribute name="xhtml:width">
  328. <data type="string"/>
  329. </attribute>
  330. </optional>
  331. <optional>
  332. <attribute name="xhtml:colspan">
  333. <data type="string"/>
  334. </attribute>
  335. </optional>
  336. <optional>
  337. <attribute name="xhtml:rowspan">
  338. <data type="string"/>
  339. </attribute>
  340. </optional>
  341. <zeroOrMore>
  342. <choice>
  343. <ref name="sectionContent"/>
  344. <element name="table">
  345. <ref name="tableContent"/>
  346. </element>
  347. </choice>
  348. </zeroOrMore>
  349. </define>
  350. <define name="inlineContent">
  351. <zeroOrMore>
  352. <choice>
  353. <!-- Not dcumented at all -->
  354. <element name="custom">
  355. <ref name="customContent"/>
  356. </element>
  357. <element name="object">
  358. <ref name="embedAttributes"/>
  359. </element>
  360. <element name="literal">
  361. <optional>
  362. <attribute name="class">
  363. <data type="string"/>
  364. </attribute>
  365. </optional>
  366. <text/>
  367. </element>
  368. <!-- From documentation -->
  369. <element name="b">
  370. <ref name="inlineElementContent"/>
  371. </element>
  372. <element name="bold">
  373. <ref name="inlineElementContent"/>
  374. </element>
  375. <element name="i">
  376. <ref name="inlineElementContent"/>
  377. </element>
  378. <element name="em">
  379. <ref name="inlineElementContent"/>
  380. </element>
  381. <element name="a">
  382. <ref name="linkContent"/>
  383. </element>
  384. <!-- From ezxml schema -->
  385. <element name="embed">
  386. <ref name="embedAttributes"/>
  387. </element>
  388. <element name="embed-inline">
  389. <ref name="embedAttributes"/>
  390. </element>
  391. <element name="strong">
  392. <ref name="inlineElementContent"/>
  393. </element>
  394. <element name="emphasize">
  395. <ref name="inlineElementContent"/>
  396. </element>
  397. <element name="link">
  398. <ref name="linkContent"/>
  399. </element>
  400. <element name="anchor">
  401. <optional>
  402. <attribute name="custom_parameter">
  403. <data type="string"/>
  404. </attribute>
  405. </optional>
  406. <optional>
  407. <attribute name="name">
  408. <data type="string"/>
  409. </attribute>
  410. </optional>
  411. <ref name="inlineContent"/>
  412. </element>
  413. <text/>
  414. </choice>
  415. </zeroOrMore>
  416. </define>
  417. <define name="inlineElementContent">
  418. <optional>
  419. <!-- From documentation -->
  420. <attribute name="custom_parameter">
  421. <data type="string"/>
  422. </attribute>
  423. </optional>
  424. <optional>
  425. <!-- From ezxml schema -->
  426. <attribute name="class">
  427. <data type="string"/>
  428. </attribute>
  429. </optional>
  430. <ref name="inlineContent"/>
  431. </define>
  432. <define name="embedAttributes">
  433. <optional>
  434. <!-- Not documented at all -->
  435. <attribute name="custom:size">
  436. <data type="string"/>
  437. </attribute>
  438. </optional>
  439. <optional>
  440. <attribute name="custom:nolink">
  441. <data type="string"/>
  442. </attribute>
  443. </optional>
  444. <optional>
  445. <attribute name="custom:image_size">
  446. <data type="string"/>
  447. </attribute>
  448. </optional>
  449. <optional>
  450. <attribute name="custom:image_class">
  451. <data type="string"/>
  452. </attribute>
  453. </optional>
  454. <optional>
  455. <attribute name="custom:type">
  456. <data type="string"/>
  457. </attribute>
  458. </optional>
  459. <optional>
  460. <attribute name="custom:link">
  461. <data type="string"/>
  462. </attribute>
  463. </optional>
  464. <optional>
  465. <attribute name="custom:hide_header">
  466. <data type="string"/>
  467. </attribute>
  468. </optional>
  469. <optional>
  470. <attribute name="custom:limit">
  471. <data type="string"/>
  472. </attribute>
  473. </optional>
  474. <optional>
  475. <attribute name="custom:country">
  476. <data type="string"/>
  477. </attribute>
  478. </optional>
  479. <optional>
  480. <attribute name="image:ezurl_target">
  481. <data type="string"/>
  482. </attribute>
  483. </optional>
  484. <optional>
  485. <attribute name="image:ezurl_id">
  486. <data type="string"/>
  487. </attribute>
  488. </optional>
  489. <optional>
  490. <!-- From documentation -->
  491. <attribute name="custom_parameter">
  492. <data type="string"/>
  493. </attribute>
  494. </optional>
  495. <optional>
  496. <attribute name="id">
  497. <data type="string"/>
  498. </attribute>
  499. </optional>
  500. <optional>
  501. <attribute name="href">
  502. <data type="string"/>
  503. </attribute>
  504. </optional>
  505. <optional>
  506. <!-- From ezxml schema -->
  507. <attribute name="object_id">
  508. <data type="string"/>
  509. </attribute>
  510. </optional>
  511. <optional>
  512. <attribute name="node_id">
  513. <data type="string"/>
  514. </attribute>
  515. </optional>
  516. <optional>
  517. <attribute name="show_path">
  518. <data type="string"/>
  519. </attribute>
  520. </optional>
  521. <optional>
  522. <attribute name="size">
  523. <data type="string"/>
  524. </attribute>
  525. </optional>
  526. <optional>
  527. <attribute name="align">
  528. <data type="string"/>
  529. </attribute>
  530. </optional>
  531. <optional>
  532. <attribute name="view">
  533. <data type="string"/>
  534. </attribute>
  535. </optional>
  536. <optional>
  537. <attribute name="xhtml:id">
  538. <data type="string"/>
  539. </attribute>
  540. </optional>
  541. <optional>
  542. <attribute name="class">
  543. <data type="string"/>
  544. </attribute>
  545. </optional>
  546. <optional>
  547. <attribute name="target">
  548. <data type="string"/>
  549. </attribute>
  550. </optional>
  551. </define>
  552. <define name="linkContent">
  553. <optional>
  554. <!-- From documentation -->
  555. <attribute name="custom_parameter">
  556. <data type="string"/>
  557. </attribute>
  558. </optional>
  559. <optional>
  560. <attribute name="href">
  561. <data type="string"/>
  562. </attribute>
  563. </optional>
  564. <optional>
  565. <attribute name="title">
  566. <data type="string"/>
  567. </attribute>
  568. </optional>
  569. <optional>
  570. <!-- From ezxml schema -->
  571. <attribute name="class">
  572. <data type="string"/>
  573. </attribute>
  574. </optional>
  575. <optional>
  576. <attribute name="xhtml:id">
  577. <data type="string"/>
  578. </attribute>
  579. </optional>
  580. <optional>
  581. <attribute name="target">
  582. <data type="string"/>
  583. </attribute>
  584. </optional>
  585. <optional>
  586. <attribute name="xhtml:title">
  587. <data type="string"/>
  588. </attribute>
  589. </optional>
  590. <optional>
  591. <attribute name="object_id">
  592. <data type="string"/>
  593. </attribute>
  594. </optional>
  595. <optional>
  596. <attribute name="node_id">
  597. <data type="string"/>
  598. </attribute>
  599. </optional>
  600. <optional>
  601. <attribute name="show_path">
  602. <data type="string"/>
  603. </attribute>
  604. </optional>
  605. <optional>
  606. <attribute name="anchor_name">
  607. <data type="string"/>
  608. </attribute>
  609. </optional>
  610. <optional>
  611. <attribute name="url_id">
  612. <data type="string"/>
  613. </attribute>
  614. </optional>
  615. <optional>
  616. <attribute name="id">
  617. <data type="string"/>
  618. </attribute>
  619. </optional>
  620. <optional>
  621. <attribute name="view">
  622. <data type="string"/>
  623. </attribute>
  624. </optional>
  625. <ref name="inlineContent"/>
  626. </define>
  627. </grammar>