imdn.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <grammar
  3. xmlns="http://relaxng.org/ns/structure/1.0"
  4. xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
  5. datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
  6. ns="urn:ietf:params:xml:ns:imdn">
  7. <start>
  8. <element name="imdn">
  9. <element name="message-id">
  10. <data type="token"/>
  11. </element>
  12. <element name="datetime">
  13. <data type="string"/>
  14. </element>
  15. <optional>
  16. <element name="recipient-uri">
  17. <data type="anyURI"/>
  18. </element>
  19. <element name="original-recipient-uri">
  20. <data type="anyURI"/>
  21. </element>
  22. <optional>
  23. <element name="subject">
  24. <data type="string"/>
  25. </element>
  26. </optional>
  27. </optional>
  28. <choice>
  29. <ref name="deliveryNotification"/>
  30. <ref name="displayNotification"/>
  31. <ref name="processingNotification"/>
  32. <empty/>
  33. </choice>
  34. <ref name="imdnExtension"/>
  35. </element>
  36. </start>
  37. <define name="deliveryNotification">
  38. <element name="delivery-notification">
  39. <element name="status">
  40. <choice>
  41. <element name="delivered">
  42. <empty/>
  43. </element>
  44. <element name="failed">
  45. <empty/>
  46. </element>
  47. <ref name="commonDispositionStatus"></ref>
  48. </choice>
  49. <ref name="deliveryExtension"/>
  50. </element>
  51. </element>
  52. </define>
  53. <define name="displayNotification">
  54. <element name="display-notification">
  55. <element name="status">
  56. <choice>
  57. <element name="displayed">
  58. <empty/>
  59. </element>
  60. <ref name="commonDispositionStatus"></ref>
  61. </choice>
  62. <ref name="displayExtension"/>
  63. </element>
  64. </element>
  65. </define>
  66. <define name="processingNotification">
  67. <element name="processing-notification">
  68. <element name="status">
  69. <choice>
  70. <element name="processed">
  71. <empty/>
  72. </element>
  73. <element name="stored">
  74. <empty/>
  75. </element>
  76. <ref name="commonDispositionStatus"></ref>
  77. </choice>
  78. <ref name="processingExtension"/>
  79. </element>
  80. </element>
  81. </define>
  82. <define name="commonDispositionStatus">
  83. <choice>
  84. <element name="forbidden">
  85. <empty/>
  86. </element>
  87. <element name="error">
  88. <empty/>
  89. </element>
  90. </choice>
  91. </define>
  92. <!-- <imdn> extension point for the extension schemas to add
  93. new definitions with the combine="interleave" pattern.
  94. Extension schemas should add proper cardinalities. For example, the
  95. <zeroOrMore> cardinality should be used if the extension is to allow
  96. multiple elements, and the <optional> cardinality should be used if the
  97. extension is to allow a single optional element. -->
  98. <define name="imdnExtension">
  99. <zeroOrMore>
  100. <ref name="anyIMDN"/>
  101. </zeroOrMore>
  102. </define>
  103. <!-- delivery-notification <status> extension point -->
  104. <define name="deliveryExtension">
  105. <zeroOrMore>
  106. <ref name="anyIMDN"/>
  107. </zeroOrMore>
  108. </define>
  109. <!-- display-notification <status> extension point -->
  110. <define name="displayExtension">
  111. <zeroOrMore>
  112. <ref name="anyIMDN"/>
  113. </zeroOrMore>
  114. </define>
  115. <!-- processing-notification <status> extension point -->
  116. <define name="processingExtension">
  117. <zeroOrMore>
  118. <ref name="anyIMDN"/>
  119. </zeroOrMore>
  120. </define>
  121. <!-- wildcard definition for complex elements (of mixed type)
  122. unqualified or qualified in the imdn namespace.
  123. Extension schemas MUST redefine this or the
  124. individual previous definitions which use this definition.
  125. In other words, the extension schema MUST reduce the
  126. allowable content in order to maintain deterministic
  127. and unambiquous schemas with the interleave pattern. -->
  128. <define name="anyIMDN">
  129. <element>
  130. <anyName>
  131. <except>
  132. <nsName ns="urn:ietf:params:xml:ns:imdn"/>
  133. <nsName ns=""/>
  134. </except>
  135. </anyName>
  136. <ref name="anyExtension"/>
  137. </element>
  138. </define>
  139. <!-- the rest of the "anyIMDN" wildcard definition -->
  140. <define name="anyExtension">
  141. <zeroOrMore>
  142. <choice>
  143. <attribute>
  144. <anyName/>
  145. </attribute>
  146. <ref name="any"/>
  147. </choice>
  148. </zeroOrMore>
  149. </define>
  150. <!-- wildcard type for complex elements (of mixed type)
  151. without any namespace or content restrictions -->
  152. <define name="any">
  153. <element>
  154. <anyName/>
  155. <zeroOrMore>
  156. <choice>
  157. <attribute>
  158. <anyName/>
  159. </attribute>
  160. <text/>
  161. <ref name="any"/>
  162. </choice>
  163. </zeroOrMore>
  164. </element>
  165. </define>
  166. </grammar>