[DFDL-WG] Catch 22.for EVDP & NVDP ?

Steve Hanson smh at uk.ibm.com
Wed Sep 17 10:45:26 EDT 2014


Having thought this through I think that you are correct. If the content 
length can never be 0 then EVDP does not apply.  I think IBM DFDL is 
issuing an error when it should not be.

Regards
 
Steve Hanson
Architect, IBM DFDL
Co-Chair, OGF DFDL Working Group
IBM SWG, Hursley, UK
smh at uk.ibm.com
tel:+44-1962-815848



From:   Mike Beckerle <mbeckerle.dfdl at gmail.com>
To:     Steve Hanson/UK/IBM at IBMGB, 
Cc:     "dfdl-wg at ogf.org" <dfdl-wg at ogf.org>
Date:   09/09/2014 15:37
Subject:        Re: [DFDL-WG] Catch 22.for EVDP & NVDP ?



Interesting.

To me if lengthKind is explicit, and non-variable (i.e., is fixed length), 
then EVDP doesn't apply, because by definition, such a representation is 
not ever empty.

I would assume that EVDP would be ignored in such a case, and an 
implementation might even generate warnings if 
dfdl:emptyValueDelimiterPolicy appeared directly on such an element or 
simpleType where a fixed length is also expressed.

This is one of the challenges that having lengthKind 'explicit' which 
handles both the fixed length, and variable-length using an expression, 
creates. Even though we don't have a lengthKind 'fixed', we still have 
fixed-length as a concept, and some other features interact with fixed 
length, like empty values.


Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology | 
www.tresys.com
Please note: Contributions to the DFDL Workgroup's email discussions are 
subject to the OGF Intellectual Property Policy


On Tue, Sep 2, 2014 at 10:31 AM, Steve Hanson <smh at uk.ibm.com> wrote:
        <xs:element name="choiceGroup" dfdl:lengthKind="implicit"> 
                <xs:complexType> 
                        <xs:choice dfdl:choiceLengthKind="implicit" 
dfdl:initiatedContent="yes"> 
                                <xs:element name="myNum1" type="xs:int" 
 dfdl:lengthKind="explicit" 
                                                                
dfdl:length="2" 
                                                                
dfdl:textNumberPattern="#0" 
                                                                
dfdl:initiator="num:" 
                                                                
dfdl:terminator="~" /> 
                                                                 > 
                                <xs:element name="myText1" 
type="xs:string" dfdl:lengthKind="explicit" 
                                                                
dfdl:length="2" 
                                                                
dfdl:initiator="text:" 
                                                                
dfdl:terminator="~" /> 
                        </xs:choice> 
                </xs:complexType> 
        </xs:element>

The above model is a choice of two elements, each of which is fixed length 
and has an initiator and terminator. Because the elements are fixed 
length, I must set dfdl:emptyValueDelimiterPolicy (EVDP) to be 'none' **. 
 I also want to discriminate using the initiator, so I set 
dfdl:initiatedContent 'yes' on the choice, so I must set EVDP to 
'initiator' or 'both' ++.  (Same for NVDP if nillable). Catch 22. 

** 'none' because the only valid empty representation is that there is 
nothing there at all. The element is fixed length X, so if the delimiters 
are present then the content must be length X and can't be zero length. 

++ 'initiator' or 'both' because an initiator must always be present when 
dfdl:initiatedContent 'yes'. 

The implication is that I can't use dfdl:initiatedContent for this choice. 
While I can switch off nillable to avoid the error with NVDP, there is no 
other way of avoiding the EVDP error. 

Regards
 
Steve Hanson
Architect, IBM DFDL
Co-Chair, OGF DFDL Working Group
IBM SWG, Hursley, UK
smh at uk.ibm.com
tel:+44-1962-815848
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

--
  dfdl-wg mailing list
  dfdl-wg at ogf.org
  https://www.ogf.org/mailman/listinfo/dfdl-wg


Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20140917/63573e90/attachment.html>


More information about the dfdl-wg mailing list