summaryrefslogtreecommitdiffstats
path: root/schemas/imdn.xml
blob: 8d44eb0aeb02d86cb625c6c301257c9e4e8ff8f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?xml version="1.0" encoding="UTF-8"?>
     <grammar
       xmlns="http://relaxng.org/ns/structure/1.0"
       xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
       datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
       ns="urn:ietf:params:xml:ns:imdn">

         <start>
             <element name="imdn">
                 <element name="message-id">
                     <data type="token"/>
                 </element>
                 <element name="datetime">
                     <data type="string"/>
                 </element>
                 <optional>
                     <element name="recipient-uri">
                         <data type="anyURI"/>
                     </element>
                     <element name="original-recipient-uri">
                         <data type="anyURI"/>
                     </element>
                     <optional>
                         <element name="subject">
                             <data type="string"/>
                         </element>
                     </optional>
                 </optional>
                 <choice>
                     <ref name="deliveryNotification"/>
                     <ref name="displayNotification"/>
                     <ref name="processingNotification"/>
                     <empty/>
                 </choice>
                 <ref name="imdnExtension"/>
             </element>
         </start>

         <define name="deliveryNotification">
             <element name="delivery-notification">
                 <element name="status">
                     <choice>
                         <element name="delivered">
                             <empty/>
                         </element>
                         <element name="failed">
                             <empty/>
                         </element>
                         <ref name="commonDispositionStatus"></ref>
                     </choice>
                     <ref name="deliveryExtension"/>
                   </element>
              </element>
         </define>

         <define name="displayNotification">
             <element name="display-notification">
                 <element name="status">
                     <choice>
                         <element name="displayed">
                             <empty/>
                         </element>
                         <ref name="commonDispositionStatus"></ref>
                     </choice>
                     <ref name="displayExtension"/>
                 </element>
             </element>
         </define>

         <define name="processingNotification">
             <element name="processing-notification">
                 <element name="status">
                     <choice>
                         <element name="processed">
                             <empty/>
                         </element>
                         <element name="stored">
                             <empty/>
                         </element>
                         <ref name="commonDispositionStatus"></ref>
                     </choice>
                     <ref name="processingExtension"/>
                  </element>
             </element>
         </define>

         <define name="commonDispositionStatus">
             <choice>
                 <element name="forbidden">
                     <empty/>
                 </element>
                 <element name="error">
                     <empty/>
                 </element>
             </choice>
         </define>

         <!-- <imdn> extension point for the extension schemas to add
              new definitions with the combine="interleave" pattern.
              Extension schemas should add proper cardinalities. For example, the
              <zeroOrMore> cardinality should be used if the extension is to allow
              multiple elements, and the <optional> cardinality should be used if the
              extension is to allow a single optional element. -->
         <define name="imdnExtension">
             <zeroOrMore>
                 <ref name="anyIMDN"/>
             </zeroOrMore>
         </define>

         <!-- delivery-notification <status> extension point -->
         <define name="deliveryExtension">
             <zeroOrMore>
                 <ref name="anyIMDN"/>
             </zeroOrMore>
         </define>

         <!-- display-notification <status> extension point -->
         <define name="displayExtension">
             <zeroOrMore>
                 <ref name="anyIMDN"/>
             </zeroOrMore>
         </define>

         <!-- processing-notification <status> extension point -->
         <define name="processingExtension">
             <zeroOrMore>
                 <ref name="anyIMDN"/>
             </zeroOrMore>
         </define>

         <!-- wildcard definition for complex elements (of mixed type)
              unqualified or qualified in the imdn namespace.
              Extension schemas MUST redefine this or the
              individual previous definitions which use this definition.
              In other words, the extension schema MUST reduce the
              allowable content in order to maintain deterministic
              and unambiquous schemas with the interleave pattern. -->
         <define name="anyIMDN">
             <element>
                 <anyName>
                     <except>
                         <nsName ns="urn:ietf:params:xml:ns:imdn"/>
                         <nsName ns=""/>
                     </except>
                 </anyName>
                 <ref name="anyExtension"/>
             </element>
         </define>

        <!-- the rest of the "anyIMDN" wildcard definition -->
         <define name="anyExtension">
             <zeroOrMore>
                <choice>
                    <attribute>
                       <anyName/>
                    </attribute>
                    <ref name="any"/>
                </choice>
             </zeroOrMore>
         </define>

         <!-- wildcard type for complex elements (of mixed type)
              without any namespace or content restrictions -->
         <define name="any">
             <element>
                 <anyName/>
                 <zeroOrMore>
                    <choice>
                       <attribute>
                          <anyName/>
                       </attribute>
                       <text/>
                       <ref name="any"/>
                    </choice>
                 </zeroOrMore>
             </element>
         </define>

    </grammar>
OpenPOWER on IntegriCloud