schedule.rng 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <grammar ns="" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  3. <start>
  4. <a:documentation>
  5. RelaxNG schema for https://events.ccc.de/congress/2015/Fahrplan/schedule.xml
  6. Validate xml:
  7. $ curl https://events.ccc.de/congress/2015/Fahrplan/schedule.xml | xmllint --noout --relaxng schedule.rng -
  8. RelaxNG: http://blog.mro.name/2010/05/xml-toolbox-relax-ng-trang/
  9. http://xmlsoft.org/xmllint.html
  10. </a:documentation>
  11. <element name="schedule">
  12. <a:documentation>root element</a:documentation>
  13. <element name="version">
  14. <data type="string"/>
  15. <!-- { pattern = "\d+\.\d+[a-z]?\s+(\S.*)" } -->
  16. </element>
  17. <element name="conference">
  18. <element name="acronym">
  19. <data type="string">
  20. <param name="pattern">\d{2}c3</param>
  21. </data>
  22. </element>
  23. <ref name="title"/>
  24. <element name="start">
  25. <data type="date"/>
  26. </element>
  27. <element name="end">
  28. <data type="date"/>
  29. </element>
  30. <element name="days">
  31. <data type="unsignedShort">
  32. <param name="minInclusive">1</param>
  33. <param name="maxInclusive">10</param>
  34. </data>
  35. </element>
  36. <element name="timeslot_duration">
  37. <ref name="hour_minute"/>
  38. </element>
  39. </element>
  40. <oneOrMore>
  41. <element name="day">
  42. <attribute name="date">
  43. <data type="date"/>
  44. </attribute>
  45. <attribute name="end">
  46. <data type="dateTime"/>
  47. </attribute>
  48. <attribute name="index">
  49. <data type="integer"/>
  50. </attribute>
  51. <attribute name="start">
  52. <data type="dateTime"/>
  53. </attribute>
  54. <oneOrMore>
  55. <ref name="room"/>
  56. </oneOrMore>
  57. </element>
  58. </oneOrMore>
  59. </element>
  60. </start>
  61. <define name="title">
  62. <element name="title">
  63. <text/>
  64. </element>
  65. </define>
  66. <define name="room">
  67. <element name="room">
  68. <attribute name="name">
  69. <ref name="roomvalue"/>
  70. </attribute>
  71. <zeroOrMore>
  72. <element name="event">
  73. <attribute name="guid">
  74. <data type="NMTOKEN"/>
  75. </attribute>
  76. <attribute name="id">
  77. <data type="unsignedShort">
  78. <param name="minInclusive">1000</param>
  79. <param name="maxInclusive">9999</param>
  80. </data>
  81. </attribute>
  82. <element name="date">
  83. <data type="dateTime"/>
  84. </element>
  85. <element name="start">
  86. <ref name="hour_minute"/>
  87. </element>
  88. <element name="duration">
  89. <ref name="hour_minute"/>
  90. </element>
  91. <element name="room">
  92. <ref name="roomvalue"/>
  93. </element>
  94. <element name="slug">
  95. <text/>
  96. </element>
  97. <element name="recording">
  98. <element name="license">
  99. <text/>
  100. </element>
  101. <element name="optout">
  102. <data type="boolean"/>
  103. </element>
  104. </element>
  105. <ref name="title"/>
  106. <element name="subtitle">
  107. <text/>
  108. </element>
  109. <element name="track">
  110. <text/>
  111. </element>
  112. <element name="type">
  113. <data type="string">
  114. <param name="pattern">lecture|podium|performance|other</param>
  115. </data>
  116. </element>
  117. <element name="language">
  118. <data type="string">
  119. <a:documentation>yes, there's really empty language tags</a:documentation>
  120. <param name="pattern">de|en|()</param>
  121. </data>
  122. </element>
  123. <element name="abstract">
  124. <text/>
  125. </element>
  126. <element name="description">
  127. <text/>
  128. </element>
  129. <element name="logo">
  130. <text/>
  131. </element>
  132. <element name="persons">
  133. <zeroOrMore>
  134. <element name="person">
  135. <attribute name="id">
  136. <data type="unsignedShort">
  137. <param name="minInclusive">51</param>
  138. <param name="maxInclusive">9999</param>
  139. </data>
  140. </attribute>
  141. <text/>
  142. </element>
  143. </zeroOrMore>
  144. </element>
  145. <element name="links">
  146. <zeroOrMore>
  147. <element name="link">
  148. <attribute name="href">
  149. <data type="anyURI">
  150. <param name="pattern">https?://.+</param>
  151. </data>
  152. </attribute>
  153. <text/>
  154. </element>
  155. </zeroOrMore>
  156. </element>
  157. <element name="attachments">
  158. <zeroOrMore>
  159. <element name="attachment">
  160. <attribute name="href">
  161. <data type="anyURI"/>
  162. </attribute>
  163. <text/>
  164. </element>
  165. </zeroOrMore>
  166. </element>
  167. </element>
  168. </zeroOrMore>
  169. </element>
  170. </define>
  171. <define name="hour_minute">
  172. <data type="string">
  173. <a:documentation>HH:MM</a:documentation>
  174. <param name="pattern">\d{2}:\d{2}</param>
  175. </data>
  176. </define>
  177. <define name="roomvalue">
  178. <data type="string">
  179. <param name="pattern">(Hall|Saal) (1|2|G|6|13)</param>
  180. <a:documentation>This is veeeery restrictive. Loosen if appropriate.</a:documentation>
  181. </data>
  182. </define>
  183. </grammar>