iana-registry.rng 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <?xml version='1.0'?>
  2. <grammar xmlns="http://relaxng.org/ns/structure/1.0"
  3. datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
  4. ns="http://www.iana.org/assignments">
  5. <define name="registryMeta">
  6. <interleave>
  7. <attribute name="id"><data type="ID"/></attribute>
  8. <optional><element name="title"><ref name="text_with_references"/></element></optional>
  9. <optional><element name="created"><ref name="genericDate"/></element></optional>
  10. <optional><element name="updated"><data type="date"/></element></optional>
  11. <optional><element name="registration_rule"><ref
  12. name="text_with_references"/></element></optional>
  13. <optional><element name="expert"><text/></element></optional>
  14. <optional><element name="description"><ref name="text_with_references"/></element></optional>
  15. <zeroOrMore><element name="note"><ref name="text_with_references"/></element></zeroOrMore>
  16. <ref name="references"/>
  17. <optional><element name="hide"><empty/></element></optional>
  18. <zeroOrMore><element name="category"><text/></element></zeroOrMore>
  19. <zeroOrMore><ref name="range"/></zeroOrMore>
  20. <optional><ref name="file"/></optional>
  21. </interleave>
  22. </define>
  23. <define name="range">
  24. <element name="range">
  25. <interleave>
  26. <element name="value"><text/></element>
  27. <optional><element name="hex"><text/></element></optional>
  28. <element name="registration_rule"><ref name="text_with_references"/></element>
  29. <optional><element name="note"><ref name="text_with_references"/></element></optional>
  30. <optional><ref name="xref"/></optional>
  31. </interleave>
  32. </element>
  33. </define>
  34. <define name="people">
  35. <element name="people">
  36. <zeroOrMore>
  37. <element name="person">
  38. <attribute name="id"><data type="ID"/></attribute>
  39. <optional><element name="name"><text/></element></optional>
  40. <optional><element name="org"><text/></element></optional>
  41. <zeroOrMore><element name="uri"><data type="anyURI"/></element></zeroOrMore>
  42. <optional><element name="updated"><ref name="genericDate"/></element></optional>
  43. </element>
  44. </zeroOrMore>
  45. </element>
  46. </define>
  47. <define name="xref">
  48. <element name="xref">
  49. <optional>
  50. <attribute name="lastupdated"><ref name="genericDate"/></attribute>
  51. </optional>
  52. <choice>
  53. <group>
  54. <attribute name="type"><value>uri</value></attribute>
  55. <attribute name="data"><data type="anyURI"/></attribute>
  56. </group>
  57. <group>
  58. <attribute name="type"><value>rfc</value></attribute>
  59. <attribute name="data">
  60. <data type="string">
  61. <param name="pattern">(rfc|bcp|std)\d+</param>
  62. </data>
  63. </attribute>
  64. </group>
  65. <group>
  66. <attribute name="type"><value>rfc-errata</value></attribute>
  67. <attribute name="data"><data type="positiveInteger"/></attribute>
  68. </group>
  69. <group>
  70. <attribute name="type"><value>draft</value></attribute>
  71. <attribute name="data">
  72. <data type="string">
  73. <param name="pattern">(draft|RFC)(-[a-zA-Z0-9]+)+</param>
  74. </data>
  75. </attribute>
  76. </group>
  77. <group>
  78. <attribute name="type"><value>registry</value></attribute>
  79. <attribute name="data"><data type="NCName"/></attribute>
  80. </group>
  81. <group>
  82. <attribute name="type"><value>person</value></attribute>
  83. <attribute name="data"><data type="NCName"/></attribute>
  84. </group>
  85. <group>
  86. <attribute name="type"><value>text</value></attribute>
  87. </group>
  88. <group>
  89. <attribute name="type"><value>note</value></attribute>
  90. <attribute name="data"><data type="positiveInteger"/></attribute>
  91. </group>
  92. <group>
  93. <attribute name="type"><value>unicode</value></attribute>
  94. <attribute name="data">
  95. <data type="string">
  96. <param name="pattern">ucd\d+\.\d+\.\d+</param>
  97. </data>
  98. </attribute>
  99. </group>
  100. </choice>
  101. <text/>
  102. </element>
  103. </define>
  104. <define name="references">
  105. <zeroOrMore>
  106. <ref name="xref"/>
  107. </zeroOrMore>
  108. </define>
  109. <define name="text_with_references">
  110. <interleave>
  111. <zeroOrMore>
  112. <text/>
  113. <optional><ref name="xref"/></optional>
  114. </zeroOrMore>
  115. </interleave>
  116. </define>
  117. <define name="richText">
  118. <zeroOrMore>
  119. <choice>
  120. <interleave>
  121. <ref name="text_with_references"/>
  122. <optional><element name="br"><empty/></element></optional>
  123. </interleave>
  124. <element name="paragraph">
  125. <interleave>
  126. <ref name="text_with_references"/>
  127. <optional><element name="br"><empty/></element></optional>
  128. </interleave>
  129. </element>
  130. <element name="artwork"><text/></element>
  131. </choice>
  132. </zeroOrMore>
  133. </define>
  134. <define name="genericRange">
  135. <data type="string">
  136. <param name="pattern">(\d+|0x[\da-fA-F]+)(\s*-\s*(\d+|0x[\da-fA-F]+))?</param>
  137. </data>
  138. </define>
  139. <define name="genericDate">
  140. <choice>
  141. <data type="date"/>
  142. <data type="gYearMonth"/>
  143. </choice>
  144. </define>
  145. <define name="hex32">
  146. <data type="string">
  147. <param name="pattern">0x[0-9]{8}</param>
  148. </data>
  149. </define>
  150. <define name="binary">
  151. <data type="string">
  152. <param name="pattern">[0-1]+</param>
  153. </data>
  154. </define>
  155. <define name="footnotes">
  156. <zeroOrMore>
  157. <element name="footnote">
  158. <attribute name="anchor"><data type="positiveInteger"/></attribute>
  159. <interleave>
  160. <zeroOrMore>
  161. <text/>
  162. <optional><ref name="xref"/></optional>
  163. </zeroOrMore>
  164. </interleave>
  165. </element>
  166. </zeroOrMore>
  167. </define>
  168. <define name="file">
  169. <element name="file">
  170. <attribute name="type">
  171. <choice>
  172. <value>legacy</value>
  173. <value>mib</value>
  174. <value>template</value>
  175. <value>json</value>
  176. </choice>
  177. </attribute>
  178. <optional>
  179. <attribute name="name"/>
  180. </optional>
  181. <data type="anyURI"/>
  182. </element>
  183. </define>
  184. </grammar>