A return path email header can take two forms:

 

1.     Plain email form:        Return-path: <steve@tresys.com>

2.     Empty form:               Return-path: <>

 

I’ve found 2 different ways to model this:

 

#1 – with a choice

 

                        <xsd:choice>

                                    <xsd:element name="Empty" type="xsd:string" dfdl:lengthKind="explicit" dfdl:length="0"/>

                                    <xsd:element name="PlainEmail" type="PlainEmail"/>

                        </xsd:choice>

 

#2 – with min/maxOccurs

 

                        <xsd:element name="PlainEmail" type="PlainEmail" minOccurs="0" maxOccurs="1" dfdl:occursCountKind="implicit"/>

 

When I’m faced with selecting one of these implementations over another, how do I think?  What criteria should I be using?

 

Is there another, better way that I haven’t even thought of?

 

TIA